Gammon Forum
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.
12,049 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.