|
Curtis Novice
Joined: 25 Nov 2002 Posts: 39 Location: USA
|
Posted: Tue Dec 03, 2002 8:21 pm
Need Help With A Trigger |
I have ZMUD 6.37 and I need some help with a 2 stage trigger. Mostly I need help with writing the #IF for second stage of trigger. Here is what I have so far:
1st Trigger: puff (%a) <--- Command input
2nd Trigger: The pipe is now empty of leaf
I want 3 actions from this last trigger:
IF %1 = pipe63237 than outpouch malloran;put malloran in pipe63237
IF %1 = pipe77978 than outpouch megillos;put megillos in pipe77978
IF %1 = pipe44576 than outpouch arkasu;put arkasu in pipe44576
Not sure if I should be using #IF. Cant seem to make this last part work correctly. |
|
|
|
DemonLlama Beginner
Joined: 03 Nov 2002 Posts: 27 Location: USA
|
Posted: Tue Dec 03, 2002 9:00 pm |
#ONINPUT {puff (%a)} {}
#COND {The pipe is now empty of leaf} {
#IF (%t1="pipe63237") {outpouch malloran;put malloran in pipe63237}
#IF (%t1="pipe77978") {outpouch megillos;put megillos in pipe77978}
#IF (%t1="pipe44576") {outpouch arkasu;put arkasu in pipe44576}
}
Okay, explanation:
The #ONINPUT command just recognizes that this is a trigger; it does nothing, and then advances to the next state (which I'm assuming you know about since this is what you're asking for).
The #COND trigger is your series of #IF statements that executes only whenever you type "puff somepipe12345". After it executes the appropriate #IF statement, it cycles the trigger back to the "puff" trigger.
Of course, you can always learn more about multi-state triggers here:
http://www.zuggsoft.com/library/trigadv.htm
~DemonLlama~ |
|
|
|
AzCowboy Adept
Joined: 09 Nov 2000 Posts: 222 Location: USA
|
Posted: Tue Dec 03, 2002 10:51 pm |
Why use multi-stage triggers at all? I'd use an alias for 'puff' and use that to capture %1 to a variable, then trigger off of the empty pipe line to do your #IF's.....
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Dec 04, 2002 2:40 am |
For more info on multi-stage triggers and more examples of how to use them, consult the Beta forum, which is where questions about beta commands and capabilities are usually handled. Here's a non-beta solution.
#ALIAS puff {#VAR pipe %1;~puff %-1}
#TR {The pipe is now empty of leaf} {#IF (@pipe = "pipe63237") {outpouch malloran;put malloran in @pipe;light @pipe;puff @pipe};#IF (@pipe = "pipe77978") {outpouch megillos;put megillos in @pipe};#IF (@pipe = pipe44576) {outpouch arkasu;put arkasu in @pipe};#IF (!((@pipe = "pipe63237") OR (@pipe = "pipe77978") OR (@pipe = "pipe44576"))) {#MESSAGE Empty pipe, contents unknown!}}
Actually, I'd probably use three different aliases (smkmal, smkmeg, smkark, for instance) in place of the puff alias. That way, I wouldn't have to remember pipe numbers myself. You'll notice on the first pipe I added commands to relight it and puff it again, don't know if you'd want them or not.
LightBulb
Senior Member |
|
|
|
Curtis Novice
Joined: 25 Nov 2002 Posts: 39 Location: USA
|
Posted: Wed Dec 04, 2002 12:08 pm |
Thank you for all the help. Works like a charm now! I will go to Beta section from now on for #cond triggers.
|
|
|
|
|
|