![](templates/Classic/images/spacer.gif) |
Erasmus Wanderer
Joined: 04 Aug 2004 Posts: 82 Location: Philadelphia
|
Posted: Fri Jul 01, 2005 9:28 pm
Sting list in a {val1|val2|val3} pattern |
I have an alias which turns on a trigger that supposed to match one of several possible outcomes. I'm trying to use a string list as part of my trigger pattern, can't seem to get it to match correctly.
So far I have something like (I apologize for the obsuure code, but I don't have the actual tirgger in front of me right now):
#VAR test {A|B|C|D}
#TRIGGER "trgTest" {^{@test blah blah blah|I can't find that|You don't have that|etc etc etc}.$} {do some stuff;#T- trgTest}
I'm trying to get the trigger to fire on any of the follwoing lines:
A blah blach blah.
B blah blach blah.
C blah blach blah.
D blah blach blah.
I can't find that.
You don't have that.
etc etc etc.
It won't match the @test correctly and I'm not sure why or how to fix it.
I have also tried:
#TRIGGER "trgTest" {^{{@test} blah blah blah|I can't find that|You don't have that|etc etc etc}.$} {do some stuff;#T- trgTest}
But that didn't match either.
Is it possible to use a string list in a pattern like this or do I need to find an alternative solution, such as creating several different triggers? |
|
_________________ Erasmus |
|
|
![](templates/Classic/images/spacer.gif) |
shalimar GURU
![](images/avatars/114658559147aeed8fee539.gif)
Joined: 04 Aug 2002 Posts: 4717 Location: Pensacola, FL, USA
|
Posted: Fri Jul 01, 2005 11:01 pm |
you can't use nested variable arrays, which is what this is:
{{@test} blah blah blah|I can't find that|You don't have that|etc etc etc}
the internal one is taken verbatim instead of expanded into the additional possibilities
try just
#TR {{@test} blah blah blah} {do your thing}
You dont really wanna do the same stuff if the item is missing anyway, do you? |
|
_________________ Discord: Shalimarwildcat |
|
|
![](templates/Classic/images/spacer.gif) |
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Fri Jul 01, 2005 11:09 pm |
I couldn't get it to work with a normal trigger, but I pieced together a regex for you
#VAR testVar {ABC123|DEF456|GHI789}
#REGEX {(?:Test123|Test456)|(?:(?:@testVar) blah blah blah)} {do whatever;and whatever else}
Will match:
Test123
Test456
ABC123 blah blah blah
DEF456 blah blah blah
GHI789 blah blah blah |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
![](templates/Classic/images/spacer.gif) |
Vijilante SubAdmin
![](images/avatars/7230815434153eca6be3ad.gif)
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Jul 02, 2005 12:56 am |
You have to turn on 'Allow wildcards within {} triggers' in the Preferences. Next you have to surround your @Test with braces, as Shalimar described.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
![](templates/Classic/images/spacer.gif) |
|
|