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
aztectemple
Newbie


Joined: 06 Aug 2005
Posts: 2

PostPosted: Thu Sep 08, 2005 10:45 pm   

Help with a trigger script
 
I am really kind of scripting challenged and would greatly appreciate some help.


I am trying to accomplish a trigger to escape a fight. Basically you have to keep trying to run away several times in order to actually escape. How do I accomplish this? Do I use an #UNTIL command?
Here's an example of the text during the game

You miss.
Dragon massacres you to tiny bits.
READY> north
You run like a girly man!
READY> north
You run like a girly man!
READY> north
You run like a girly man!
READY> north
You run like a girly man!
Mountaintop {n, s}
READY>

My feable attempt at the script is the following:
#TRIGGER {Mountaintop} {#VAR A 0}
#UNTIL {A = 0} {north}

The script fails because the loop does not end on time when you reach the mountaintop.

Please help!
Thank you very much!
Reply with quote
tye
Beginner


Joined: 24 Feb 2005
Posts: 27

PostPosted: Wed Sep 14, 2005 7:31 pm   
 
Are you using the automapper? If so, one possibility might be to continue issuing the direction command until the room number changes. That might look something like this:

#ALIAS flee {#VAR curr_room %roomnum;#UNTIL {%roomnum <> curr_room} {%1} }

Then, to run away, you'd type in 'flee north', and would continue fleeing north until the room number changed (or you died -- which might be of interest in terms of terminating the script properly).

Note: I have not tested the above alias. I'm assuming %roomnum is the command for getting the current room number, when the automapper is active. And I'm assuming the not-equal-to logic is correct. Plus, you may want to put in some logic that will exit the UNTIL if something else happens....like an OR clause kind of thing....anything that can run an infinite number of times is generally a scary proposition.
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