Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
UberKnight
Newbie


Joined: 02 Jun 2007
Posts: 2

PostPosted: Sat Jun 02, 2007 12:24 am   

General info on mob killing / area script
 
Good day all -

I can get most of my triggers to work as I want, however they are usually pretty simple. What I am looking for is some general info on how to create a script that can walk a character through an area (approx 100 rooms) on a loop, killing all monsters within that area.

What I can't seem to get around is how to know when the monsters will all be dead in the room and to bury and move on to the next. I can not have it bury after each "XXXX died." because well - scripts are mostly illegal (atleast that sort anyway) so I need the delay to come after all in the room are dead.

Any general info would help. If someone would like details of the area I can provide them.

Thanks in advance.

UberKnight
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Jun 02, 2007 1:19 am   
 
If scripts to automatically move and slay while you're at the screen (or if you're not!) are illegal, I advise not using them. There are quite easy ways to detect potential botters, mostly stemming from the regular interval between commands. That said, at the most basic level, you need to have a map of the area. The easiest way to write a bot is to have it follow a specific path every time (another thing which is easy to detect), storing each of the directions in a string list. Your bot will then move in the first direction from the list, respond to any aggressive monsters that've targetted him by triggering on their aggression message, building a list of aggressive monsters in the room, and then killing them one by one. Then your bot will LOOK and build a list of monsters remaining in the room and kill each of them in turn. Each time the bot recieves a "You have killed xxx" message, it adds the name to a list. Once everything in the room is dead, it buries all the corpses and then moves in the next direction from the list.

A more complicated method could have your mob move in a random, valid direction each time the current room is empty. If the room it enters is empty, it'll proceed to another room. This can cause problems with the bot getting stuck, though (for example, if a room had three exits, but two of the exits led to dead ends. The bot has a 33% chance of getting out each move - could be stuck for a while) so I don't advise it.

I hope this information will help you write the script on your own. To actually write this kind of script for you, we'd need to know an awful lot about your MUD. What room descriptions look like, both with a single exit and with multiple exits, what mobs look like when they appear in the room (assuming they always look the same), what message you receive when a mob aggros, what message you receive when a mob dies, what your attack commands are, and probably a lot else. You can see why building this script for someone else can be very complicated indeed. Having said that, I'm sure, if you can provide enough info, that someone might be able to give you some code to at least get you started.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
UberKnight
Newbie


Joined: 02 Jun 2007
Posts: 2

PostPosted: Sun Jun 03, 2007 4:17 am   
 
Thank-you for the response. I do not need anyone to write such a script for me (at least not an entire one). More so, I just need some guidance. Lets say for example that a room would look something like.

Dark Cavern (nw).
Bob, Sam, and George are here.

...move nw....

Dark Cavern (n, se).
Sally, Billy, Tom, and Harry are here.

....move n.....

Dark Cavern (ne,s).

....move ne....

Dark Cavern (n,sw).
Moe is here.


You get the point. They do not auto upon entry and the names can be pretty random. If I were to look at them all I would see
"Sally the human.
She is in great shape."
"Billy the dwarf.
He is in great shape."

...etc. I could target them all with 'kill creatures'

So how would I be able to 'count' how many are in the room, so I could ensure I killed them all...then bury...then move to the next room...and on. I would imagine at the "last" room of the loop, I would run back to the beginning and just keep going.

Any help is appreciated.

Thanks!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Jun 03, 2007 5:25 am   
 
The exact method depends on exactly what kind of creatures appear in the room. Do the enemies always have names unique from one another? Is there a fixed list of possible names? And do the enemies always have one-word names? If the latter two are true then you can do something as simple as

#alias onroomenter {#t+ MobDetect;MobList=""}
#trig "MobDetect" {(.+ are here.|(\w+) is here.)} {#if (%ends(%1, "are here.") {#var Moblist %subchar(%line," ,","|");#delitem MobList "and";#delitem MobList "are";#delitem MobList "here."} {#var Moblist %2};#t- MobDetect} "" {regex}

The %subchar function replaces spaces with pipes and removes commas. The non-mob items are removed, and you should end up with a nice list of mobs.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net