Trigger problems

Posted by Pinnacle on Tue 08 Oct 2002 12:23 PM — 3 posts, 15,980 views.

#0
I tried doing a trigger with the next line as my triggered text:
You receive 23994 experience points out of a maximum of 24000.
And in my trigger configuration, I had the next line for my trigger:
You receive %1 experience points
And the text to send is:
Get all corpse
Can anyone tell me what's wrong with the above trigger?
Canada #1
It seems like you want to create a trigger line that matches on the line you quoted, but with any values offered, as well as the ones you show. In other words, ya need some wildcards. ...So, your trigger line should probably be something like this:

You receive * experience points out of a maximum of *.

With a line like that, %1 would reflect the first wildcard (How much exp you gained), and %2 would be the second wildcard (The maximum exp).
USA #2
Like Magnum said... lol

Was trying to post my own reply here but got beaten.

In any case your confusing came from the fact that %0 - %10 are only temporary variables, not matching patterns. The reason for this is that you would have to change the rules if you used a triggers as a regular expression.

In normal triggers * means match anything in between, but in regular expressions it means only 'match one or more of what I want' and '.' means 'anything'. Thus your trigger would be described as, "starting at the beginning of the line ^ match on 'You receive ', followed by one or more of anything .*, followed by ' experience points'" or:

^You receive .* experience points

Unlike normal triggers, regular expressions match 'anywhere', unless you specifically tell them where the start or end of the lines should be with ^ and $. It is the difference between asking 'is this line an exact match' with normal triggers and 'does this line -contain- what I want' with regular expressions. You could also tell it \d* instead, which means 'match one or more numbers and only numbers'. Sometimes it is very handy to be specific about what you want and if you used the % variables in your match text, you couldn't do that without creating some confusion. ;)