|
jed Adept
Joined: 18 Dec 2005 Posts: 246
|
Posted: Tue Aug 08, 2006 2:32 am
pull mob script to a room |
I play a mud where you can pull a mob from one room to another. I have a number of mobs that I would like to pull to a particular room, and would like some help writing a script to do so. assuming a mob's name is henry and I want to pull it to a room called saferoom, I would like to use a command something like "pull henry saferoom". At that point I would like to pull the mob to that room. However as far as i know, my mud only supports pulling mobs one room at a time, so it will need to step through the path and use the pull henry east or pull henry west depending on which direction is next in the path. I did some testing with the #LMAP command but could only get the command to display the names of the rooms in the path, not to actually give the commands to go through the path. I am thinking something that will get the directions to the room with %walk 1687 (assuming 1687 is the room number) and feed that through a loop command also using path and step. One problem is that the speedwalk string is in the form 2e3n so if one were to sore this as a string list it would try to expand on 2|e|3|n rather than e|e|n|n|n... I know this isn't much to go by, but any help would be appreciated.
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue Aug 08, 2006 3:47 am |
You can use your original idea of #LMAP. Just use %nextdir to get the next direction to be sent. Otherwise, with your second idea of using %walk, use %pathexpand to convert the path to a stringlist.
|
|
_________________ Kjata |
|
|
|
jed Adept
Joined: 18 Dec 2005 Posts: 246
|
Posted: Tue Aug 08, 2006 4:13 am |
THANK YOU!!!!
I got it to work with:
#var pullway %pathexpand( %walk( 8927))
#show @pullway
#forall @pullway {pull %1 %i}
#teleport 8927
Thanks again for the help! |
|
|
|
|
|