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


Joined: 31 Oct 2004
Posts: 94

PostPosted: Thu Mar 27, 2008 3:12 am   

Conditionals
 
So basically, I want to use conditionals to make a decision tree. As may or may not be the case, I have found that the trigger states fire sequentially. Is there a way that I can make multiple conditionals fire after the trigger fires? Or do i need to have multiple triggers of the same thing each with independent #CONDs?
_________________
Rufus- Winner of Stuff
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Thu Mar 27, 2008 8:49 am   
 
There're a couple of ways of doing this. Here're some examples where pattern1 is optionally followed immediately by either opattern1 or opattern2.

#trig {pattern1} {}
#cond {({opattern1|opattern2})} {#if (%1=~"opattern1") {pattern 1 commands} {pattern 2 commands}} {within|param=1}

or

#trig {pattern1} {#t+ OptionalStuff}
#cond {} {#t- OptionalStuff} {skip|param=1}

In the OptionalStuff class, which should be disabled and have disable on startup checked:

#trig {opattern1} {pattern 1 commands}
#trig {opattern2} {pattern 2 commands}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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