 |
kymon Novice
Joined: 29 Jan 2003 Posts: 40
|
Posted: Wed Jan 29, 2003 6:28 pm
wildcards in patterns using | |
"You kick (*) with all might" works well as pattern, as does "You take the last laugh kicking".
however if you combine them using |, like:
{You kick (*) with all might|You take the last laugh kicking}
it messes up.
the problem seem to be any wildcards in patterns. any idea what can be done to make it work? |
|
|
|
 |
Evangelist Adept
Joined: 10 Oct 2000 Posts: 224 Location: USA
|
Posted: Wed Jan 29, 2003 6:42 pm |
have you tried.
{You kick &kicktarget with all might|You take the last laugh kicking}
Granted, you may not need the kicktarget variable, but it may work instead of a wildcard
Evangelist/Pernius
telnet://phidar.com:9000 |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Jan 29, 2003 6:52 pm |
The solution is really quite simple.
#TR {You kick (*) with all might} {#SAY This has a ~%1, which is %1.}
#TR {You take the last laugh kicking} {#SAY This doesn't have a ~%1.}
That's right, just use two triggers.
From what I've heard (I haven't bothered testing it), wildcards don't work inside stringlists. I also haven't tested putting different numbers of parameters in stringlists, but I'd expect that to fail every time also.
LightBulb
Senior Member |
|
|
|
 |
kymon Novice
Joined: 29 Jan 2003 Posts: 40
|
Posted: Wed Jan 29, 2003 6:53 pm |
unfortunately that doesn't work either...i used the "test trigger" option, and it accepts "You kick &kicktarget with all might", but not "You kick testmob with all might"
|
|
|
|
 |
kymon Novice
Joined: 29 Jan 2003 Posts: 40
|
Posted: Wed Jan 29, 2003 6:58 pm |
yes, making two triggers does work, but that's what i want to avoid. in this case i want to have the same "value" to over 20 different "patterns". i would need to change >20 triggers each time i correct something in the value. if there is no other way, i will do just that though, thanks for your replies :)
|
|
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Jan 29, 2003 8:10 pm |
Like LightBulb said, wildcards aren't allowed inside {}'s in the pattern. You have two options: use patterns that are a bit more creative, or make multiple triggers.
With the creative patterns method you can do:
#TRIGGER {You {kick|take the last} (*) {with all might|kicking}} {commands}
I'm not sure if you'd really want the text matched by * saved to %1 in this case since it may either be whatever comes between "kick" and "with" in the first message or the word "laugh" in the second message. This would not be so much of a problem if it weren't for the fact that figuring out which of the two lines was the one that fired the trigger would be more complex than simply splitting the triggers in two.
For the multiple triggers method, you may create an alias if you want to only update common code once and in one place:
#ALIAS myAlias {commands}
#TRIGGER {You kick (*) with all might} {myAlias}
#TRIGGER {You take the last laugh kicking} {myAlias}
Kjata |
|
|
|
 |
kymon Novice
Joined: 29 Jan 2003 Posts: 40
|
Posted: Wed Jan 29, 2003 8:45 pm |
I will do the multiple triggers with alias method, though i realy like the idea of "creative patterns". thanks lots!!!
|
|
|
|
 |
|
|
|