|
umdbandit Wanderer
Joined: 31 Oct 2004 Posts: 94
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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} |
|
|
|
|
|