[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Weird trigger behaviour
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Weird trigger behaviour

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Oriol   (31 posts)  [Biography] 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>
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] 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[!.]$
[Go to top] top

Posted by Oriol   (31 posts)  [Biography] 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.
[Go to top] 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.


3,428 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] 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.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]