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
SpiritWolf
Wanderer


Joined: 02 Jul 2002
Posts: 74
Location: USA

PostPosted: Mon Mar 31, 2003 10:52 pm   

two triggers going off at the same time
 
Ok, I have two triggers that I'm having problems with.
#TRIGGER {You failed to pick the lock.$} {#alarm +5 {#if (@doordirection = "") {~pick @doorname} {~pick @doorname @doordirection}}} "picklock"
#TRIGGER {You failed to pick the lock.$Damn! You broke your * too!} {#alarm +5 {get @picks @pickcontainer;hold @picks;#if (@doordirection = "") {~pick @doorname} {~pick @doorname @doordirection}}} "picklock"

First one is only supposed to go off if the single line 'You failed to pick the lock.'

The second one is only supposed to go off when both lines 'You failed to pick the lock.' and 'Damn! You broke your set of lockpics too!' is recieved from the mud.

The problem is, the first trigger fires when the second one does because of the same matching pattern in the first part of the second trigger. Is there any way to only make one or the other fire without having to make another class and trigger for just the 'Damn! You broke your set of lockpics too!' pattern?

I can't just trigger off that alone because I might also get that line if I am sucsessful, in which case I have another trigger to remove the picks and re-wield weapons.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Mar 31, 2003 11:42 pm   
 
The problem is to get a new set of lockpicks out whenever you break them, right?

#TR {You failed to pick the lock.$} {#ALA +5.1 {~pick @doorname @doordirection}}
#COND {^Damn! You broke your * too!} {#ALA +5 {get @picks @pickcontainer;hold @picks}} {Dur|Param=90}

That should trigger on the first line and set a 5.1 second alarm to pick the door. If the next line matches, a 5-second alarm will be set to get and hold the new picks first.
NOTES: If @doordirection is blank, you'll just have a space at the end so it didn't seem necessary to check it.
I only allowed .09 seconds to receive the second line (the one about breaking the lockpicks). That ensures the 5 second alarm will go off before the 5.1 second alarm from the first state.

LightBulb
Advanced Member
Reply with quote
SpiritWolf
Wanderer


Joined: 02 Jul 2002
Posts: 74
Location: USA

PostPosted: Tue Apr 01, 2003 12:03 am   
 
ah, thanks.
I had a trigger like that before, but I had the problem on it getting stuck on the 2nd state and never firing on just the pick failure after that. Guess I was just missing the part about setting it back to the first state.
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