Weird trigger behaviour

Posted by Oriol on Thu 14 May 2009 03:29 PM — 3 posts, 16,932 views.

#0
Hello all,
Something weird's going on. This morning i was coding a trigger that would match a fighting line on the alter aeon mud, which usually looks like this:
Your slash hits a guard.
Your slash decimates him!
So I thought I would make a trigger with a regular expression that would match for alternatives and capture the weapon and the damage type, but the trigger I'm posting below seems to be matching on *every* line that arrives from the mud and not returning any wildcard, even if the line looks like what it's supposed to match.
I'dappreciate it if someone could tell me what I'm doing wrong here.
Thanks.

<trigger
match="^.* (bite|chop|crush|fiery slash|burning slash|flaming slash|kick|pierce|pound|punch|slash|stab|whip) (scratches|hits|wounds|injures|mauls|decimates|devastates|maims|MUTILATES|DISMEMBERS|DISEMBOWELS|MASSACRES|\*\*\* MASSACRES \*\*\*|\*\*\* DEVASTATES \*\*\*|\*\*\* OBLITERATES \*\*\*|\*\*\* DEMOLISHES \*\*\*|\*\*\* ANNIHILATES \*\*\*|\*\*\* DESTROYS \*\*\*) you!|.$"
regexp="y"
script="fight2"
sequence="100"
>
</trigger>
Netherlands #1
Probably the | near the end of your regular expression is to blame for that. Right now, I believe it will match on any line ending with a random character. :)

My guess is that | should be a \, and that you made a really unlucky typo combined with a lack of (). :) Try making the end into: you[!.]$
Amended on Thu 14 May 2009 06:28 PM by Worstje
#2
Hey, worsejen, thanks so much for your advice, it coudln't be clearer. i got it working and i could delete a bunch of triggers i had set for each weapon/damtype. Thanks man.