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
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: 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.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: 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!
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