Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Weird trigger behaviour
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Oriol
(31 posts) Bio
|
Date
| Thu 14 May 2009 03:29 PM (UTC) |
Message
| 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>
| Top |
|
Posted by
| Worstje
Netherlands (899 posts) Bio
|
Date
| Reply #1 on Thu 14 May 2009 06:26 PM (UTC) Amended on Thu 14 May 2009 06:28 PM (UTC) by Worstje
|
Message
| 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[!.]$ | Top |
|
Posted by
| Oriol
(31 posts) Bio
|
Date
| Reply #2 on Thu 14 May 2009 08:28 PM (UTC) |
Message
| 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. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
13,762 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top