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


Joined: 25 Aug 2007
Posts: 1

PostPosted: Sat Aug 25, 2007 12:15 am   

Question about Triggers
 
Hi, I've encountered a strange situation. The pattern is something like this:

----------------------------------------------------------------
To get your reward, please "claim" the secret password.
The password is:

AkOj

DKloe
----------------------------------------------------------------

and then player should enter "claim AkOjDKloe"

I set 2 triggers,

#TR {The password is:%s$(%x)} {#var string1 %1;#t+ pw1;#SH Word 1 is:} {pw0}
#TR {Word 1 is:%s$(%x)} {#t- pw1;claim @(string1)%1} {pw1}

However, the second trigger never gets to work.......
I wonder how to set a trigger under this circumstance........
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Aug 25, 2007 1:05 am   
 
The reason this doesn't fire is because you end up with a blank line between "Word 1 is:" and the second password. There's a much easier way to do this using multistate triggers:

#trig {The password is:} {}
#cond {^(%x)} {}
#cond {^(%x)} {claim %concat(%t1,%t2)}

You might want to reconsider using %x and replacing it with %a or %w, which are more specific, but if %x is working, don't worry about it.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Aug 25, 2007 1:11 am   
 
Try this

#TRIGGER "claim" {^The password is:} {#T+ "capclaim";claim=""}
#COND {^----------------------------------------------------------------} {#T- "capclaim";claim @claim}
#TRIGGER "capclaim" {(*)} {claim=%concat(@claim,%trim("%1"))}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Aug 25, 2007 1:14 am   
 
Fang's example is the example I was gonna post and his will work if there are always 2 lines of the password

My example should work if it is a random amount


Also remember if your mud is doing it this way in order to make it harder to trigger on then you are possibly breaking the rules
_________________
Zmud Support Library
Zmud Knowledge Base
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