|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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?
|
|
|
|
DeReP Adept
Joined: 14 Jun 2003 Posts: 222 Location: Chile
|
Posted: 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}
} |
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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.
|
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Wed Jun 01, 2005 10:38 pm |
How about you give a DETAILED example?
Might help a little.
Mud display included as well. |
|
_________________
|
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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 |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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... ;) |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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... ;) |
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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
|
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Thu Jun 02, 2005 12:02 am |
#TRIGGER {^({Test1|Test2|Test3|Test4})} {kill %1}
|
|
|
|
|
|