Trigger matching an expanding variable

Posted by Trevize on Mon 04 Jan 2010 08:15 PM — 3 posts, 18,202 views.

#0
<variable name="names">trevize|crean|kacie|zeltik</variable>

<trigger
expand_variables="y"
ignore_case="y"
match="^(\w+) waves (his|her) hands quickly in front of the eyes of a Vodun doll of @!names\.$"
regexp="y"
send_to="12"
sequence="100"
>
<send>Note("Matched")</send>
</trigger>


It's quite obvious what I want to do. I'm sorry for most likely asking for an answer that is somewhere in this forum already but I've been searching for a hour or so now..

Also the reason I want to match a variable instead of adding it into the trigger itself by doing (crean|zelik|trevize|kacie) is that I have many triggers with these specific names and I want to be able to change the names easily.

Thanks
USA #1
You want to put parentheses around that: (@!names)

This is incredibly confusing, haha, every time I see a post from you I think it's from one of my friends who also uses the name Trevize. But he has a different alias on these forums... >_<

EDIT: For what it's worth, yes, it's obvious what you want to do, but it is far from obvious what the issue you're having is.
Amended on Mon 04 Jan 2010 08:23 PM by Twisol
USA #2
For future code posts:
Template:codetag
To make your code more readable please use [code] tags as described here.


Twisol said:

You want to put parentheses around that: (@!names). This is incredibly confusing, haha, every time I see a post from you I think it's from one of my friends who also uses the name Trevize.


Same thing I said to myself. I was like 'Oh comon Trevize, you know WAY better than that'. Then I remembered that's not his S/N here.

Twisols answer is correct. Must have an expanded variable group in ()'s in a trigger match.