|
ferdjones Newbie
Joined: 22 May 2002 Posts: 1 Location: USA
|
Posted: Thu Apr 25, 2002 7:35 pm
Turning off triggers at the end of slowwalking |
Hi.
I've created the necessary triggers to successfully move a bot along a path and perform certain actions.
However, at the end of the path I wish to turn off the triggers.
How can I know when I have reached the end of a slowwalk path ?
I notice that if I do a #path it says Path Ahead:<empty>
Alternatively, if someone could tell me how to force zmud to trigger on it's own output, that could do.
___________________________________________
He who fights and runs away, lives to fight another day.
/Sir Runsalot |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Apr 25, 2002 10:22 pm |
Sadly you can not triger on the path ahead. What you have to do is make an alias to set the path for you that will figure what the last room is. Then use a trigger that fires in each room to check whether you are in the last room, and turn things off.
So you are looking for something like:
#AL SlowWalk {DestRoom=-1;#IF (%null("%1")) {#ECHO Must specifiy destination!} {#IF (!%defined("%1")) {#IF (%null(%alias("%1"))) {#IF (%isnumber(%1)) {#IF (%null(%roomname(%1))) {#ECHO Room number:%1 does not exist!} {DestRoom=%1;Route=%walk(%1)}} {#ECHO Must provide a valid path name, path variable, or room number!}} {DestRoom=0;Route=%alias("%1")}}} {DestRoom=0;Route=@{%1}};#IF (@DestRoom!=-1) {#IF (@DestRoom=0) {#ECHO have to check route for validity, and set DestRoom to correct number};#IF (@DestRoom>0) {#SLOW @Route} {#ECHO Specified routing information did not make sense.}}}}
That is a big mass of error checking but lets you specifiy variable names, paths you have stored as such, and fiat room numbers. For everything other then a room number you will have to have another mass of code to step through the map and find out what room number it ends on. Depending on whether you have set things like door commands in paths that may be more difficult then it sounds.
If you give me some more details I may be able to write it up for you. My own setup just uses room numbers because I was a little to lazy to do it otherwise.
Also you will have to have the snippet inserted into an appropiate trigger:
#IF (%roomnum=@DestRoom) {#T- SomeClassNameHere} |
|
|
|
Sildaren Wanderer
Joined: 19 Jul 2001 Posts: 59 Location: Germany
|
Posted: Fri Apr 26, 2002 8:58 am |
You can just include zMUD commands into a path. Like:
#path testing {3n2w;cleanup}
Then you can put all the commands your bot needs at the end of the path into the alias 'cleanup'. |
|
|
|
|
|