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
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Jun 01, 2005 7:23 pm   

combat
 
is it possible to use a trigger with a pattern like this, {a|b|c|d}, and then make whatever one causes the trigger to fire be referred to, such as take a if a was the pattern matched?
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Wed Jun 01, 2005 8:47 pm   
 
Yes
#TRIGGER {{(a|b|c|d)}} {
#IF (%1="a") {do this}
#IF (%1="b") {do that}
#IF (%1="c") {do this}
#IF (%1="d") {do that}
}
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Jun 01, 2005 10:18 pm   
 
well the problem with that that is a really long way to do it, i could have just made 4 individual triggers, and im assuming theres some way with zmud that will id to what was just matched.
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Wed Jun 01, 2005 10:38 pm   
 
How about you give a DETAILED example?
Might help a little.
Mud display included as well.
_________________
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Jun 01, 2005 11:08 pm   
 
well here is a better example, mobs

#TR {dog|cat|sheep|bus} {kill stupid}
now where stupid is, i want it to be either dog, cat, sheep, or bus, depending on which one set off the trigger. i tried using %1, that didn't work. i dont want to make 4 if statements to control it either if there is a function such as %patternmatch(made up example) that i can use as "kill %patternmatch" instead of "kill stupid" that will fill in "%patternmatch" with whatever caused the trigger to fire
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Wed Jun 01, 2005 11:08 pm   
 
You mean something like
#TRIGGER {^{(Test1|Test2|Test3|Test4)}} {kill %1}
?
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Wed Jun 01, 2005 11:10 pm   
 
we replied at the same time. you were missing the extra parenthesis. also, you'll want to put a ^ at the start, or you'll get a loop. well, see the example
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Jun 01, 2005 11:34 pm   
 
that was just a quick example, i have it anchored and all so its fine, i just am looking for the command. i tried %1, it didn't work
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Jun 02, 2005 12:02 am   
 
#TRIGGER {^({Test1|Test2|Test3|Test4})} {kill %1}
_________________
Zmud Support Library
Zmud Knowledge Base
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