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
Daagar
Magician


Joined: 25 Oct 2000
Posts: 461
Location: USA

PostPosted: Tue Dec 10, 2002 7:36 pm   

Simple trigger help
 

I feel silly asking this, but the syntax is beyond me today. I need to have a single trigger that can trigger on:
E[]

and on:
E[42%]

Obviously, to trigger on each case individually is a snap. But how do I make a single trigger that can react to both cases? Thanks.
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Tue Dec 10, 2002 8:38 pm   
 
How about:

#TRIGGER {E~[(%*)~]} {#SAY Value between brackets is "%1"}



 - Charbal
Reply with quote
Daagar
Magician


Joined: 25 Oct 2000
Posts: 461
Location: USA

PostPosted: Tue Dec 10, 2002 9:38 pm   
 

Close, but I need to capture the numerical value separate from the % symbol (ie., grab the '42' alone, with something like E~[(%d}~%~]). Unfortunately, that breaks the case where it is empty (E[]).
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Tue Dec 10, 2002 10:28 pm   
 
Okay, try:

#TRIGGER {E~[(*){%|}~]} {#SAY Number value between brackets is "%1"}

 - Charbal
Reply with quote
Daagar
Magician


Joined: 25 Oct 2000
Posts: 461
Location: USA

PostPosted: Wed Dec 11, 2002 12:01 am   
 

Thanks! That works. I had tried a variation of that and couldn't make it work:
E~[{(%d)~%|}~]

This will do fine, though.
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