|
Hypo Beginner
Joined: 15 Mar 2007 Posts: 18
|
Posted: Sat Jul 07, 2007 9:51 pm
Trigger patterns containing variables? |
I want to create a trigger that will update a variable (calledport) only when a portal request is called by the someone I basically authorise to request portals.
MUD output looks along the lines of
Code: |
[adagio] Kaula: port dojo |
Where "adagio" is the group name;I already have this stored in the @groupname variable for capture purposes.
"Kaula" is an example of a player, one I'll port for.
and "port dojo" is the request, without "port" in it, this would be normal group chat.
In trying to do this, I created a string list variable, @leaders.
So, my tentative trigger is:
#trigger {^~[@groupname~] @leaders: port (*)} {#var calledport %-1;#say Port request to @calledport}
However, it just doesn't work. Are variables not allowed in the the trigger pattern? The reason I use one, instead of a non-variable stringlist (which does work), is so that I can update it easily on the fly with #additem. |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Sat Jul 07, 2007 10:05 pm |
Very odd, that should work, there are no extra spaces as you've put the mud output in code and there are none.
Things I can think of that could be wrong:
The trigger has ended up being ticked as a regex somehow in which case it wouldn't work.
Those particular groups and leaders don't exist in the variables.
The trigger is somehow not accessing the variables correctly, perhaps they're in another package.
Last but certainly not least @leaders: is being misinterpreted as the full name of the variable so try {@leaders}: instead.
EDIT: Ha ha, got a ninja on Fang!! |
|
_________________ Taz :)
Last edited by Taz on Sat Jul 07, 2007 10:06 pm; edited 1 time in total |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Jul 07, 2007 10:05 pm |
The syntax for a list of patterns is {pattern1|pattern2|pattern3} - since the format of a stringlist variable is name1|name2|name3, surrounding the variable with {} will give the effect you want. The pattern becomes this:
^~[@groupname~] {@leaders}: port (*)
EDIT: Simultaneous postin', baby. You - and me. Bah bah! |
|
|
|
Hypo Beginner
Joined: 15 Mar 2007 Posts: 18
|
Posted: Sat Jul 07, 2007 10:18 pm |
Excellent, that took care of it. Thanks a lot. :)
|
|
|
|
|
|