|
tomcat025 Wanderer
Joined: 30 Dec 2001 Posts: 66 Location: USA
|
Posted: Fri Apr 26, 2002 3:10 am
Variable and #cw |
Is there any way to use the #cw command with a variable? as in
#trigger {@critters} {#cw red,bright}
When I do it this way, it insists on matching every value in the variable. I have quite a few critter names in the variable. the match line "for testing" says it must match something like musk hog|gypsy marauder|wood troll where I just want it to match any of the values. I wanted to get away from making one trigger per critter.
Thanks for any help
TC <I'm trying, really I am. :p |
|
|
|
Sildaren Wanderer
Joined: 19 Jul 2001 Posts: 59 Location: Germany
|
Posted: Fri Apr 26, 2002 8:37 am |
Should work with a trigger like
#trigger {{@critters}} {#cw red,bright}
(when the parser processes the #trigger command, it strips one set of braces, so you need a second one to create a {name1|name2|name3} style pattern.
(not tested) |
|
|
|
tomcat025 Wanderer
Joined: 30 Dec 2001 Posts: 66 Location: USA
|
Posted: Fri Apr 26, 2002 10:44 am |
I tried that trigger and it froze my Zmud. Had to start the backup.
TC <I'm trying, really I am. :p |
|
|
|
Talanthas Beginner
Joined: 26 Mar 2001 Posts: 12 Location: earth
|
Posted: Fri Apr 26, 2002 12:47 pm |
I don't seem to have the brain power this morning to figure out what pattern you need to match on, but I think I've got a pretty good handle on the response.
If you try something like this:
#if {%ismember( %1, @critters)} {#cw @critters {red,bright}} {#noop}
I think that will work. You'll need to replace %1 with the correct system variable in your pattern, though.
Talanthas |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Apr 26, 2002 12:51 pm |
If zMUD freezes when you do what Sildaren suggested, check the @critters to see if it doesn't contain any empty elements. That is, it should be like:
item1|item2|item3|item4
and not:
item1||item2|item3|item4
or:
item1|item2|item3|item4|
or anything like that.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Apr 27, 2002 5:37 pm |
In order to overcome the parser's tendency to strip special characters you need 3 sets of {} for command line entry.
#TR {{{@critters}}} {#CW {red,bright}}
LightBulb
All scripts untested unless otherwise noted |
|
|
|
|
|