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
Curtis
Novice


Joined: 25 Nov 2002
Posts: 39
Location: USA

PostPosted: 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.
Reply with quote
DemonLlama
Beginner


Joined: 03 Nov 2002
Posts: 27
Location: USA

PostPosted: 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~
Reply with quote
AzCowboy
Adept


Joined: 09 Nov 2000
Posts: 222
Location: USA

PostPosted: 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.....
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
Curtis
Novice


Joined: 25 Nov 2002
Posts: 39
Location: USA

PostPosted: 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.
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