Register forum user name Search FAQ

Gammon Forum

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 ➜ Trigger Bug (?)

Trigger Bug (?)

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


Posted by Shadoweave   (42 posts)  Bio
Date Wed 12 Dec 2007 04:20 PM (UTC)

Amended on Wed 12 Dec 2007 04:21 PM (UTC) by Shadoweave

Message
Triggers:

<trigger
   enabled="y"
   group="Warrior"
   lines_to_match="2"
   keep_evaluating="y"
   match="^[A-Z][a-z]+ swings (.*) at you(?:.*)?\."
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>EnableTriggerGroup ("Poisons")
if (string.find("%1", "rapier")) or (string.find("%1", "scimitar")) or (string.find("%1", "broadsword")) or (string.find("%1", "longsword")) then
EnableTriggerGroup ("BM")
end </send>
 </trigger>

<trigger
   group="BM"
   lines_to_match="2"
   match="[A-Z][a-z]+ \w+ your (right|left) (arm|leg)\, striking a major artery that splurts blood in all directions\.$"
   multi_line="y"
   name="bm_aff_artery"
   regexp="y"
   script="add_artery"
   send_to="12"
   sequence="50"
  >
  </trigger>

And at the next prompt I do this:

<trigger
   keep_evaluating="y"
   match="^(\d+)h\, (\d+)m\, (\d+)e\, (\d+)p\, (\d+)en\, (\d+)w (\w+)\-$"
   name="cond_prompt"
   regexp="y"
   send_to="12"
   sequence="50"
  >
<send>EnableTriggerGroup ("Poisons", false)
EnableTriggerGroup ("BM", false)</send>
  </trigger>

Why do I get this when the three triggers hit? Note that I don't get it sometimes.

Razeal swings a spider-hilted rapier at you. Razeal cuts your right leg, striking a major artery that splurts blood in all directions.
** ARTERY_RIGHTLEG **
2300h, 2790m, 3000e, 10p, 21007en, 13018w ek-
** ARTERY_RIGHTLEG **

And my regular prompt trigger doesn't fire also, the usual prompt trigger is set to modify the prompt.
Any ideas why this is happening?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 12 Dec 2007 07:45 PM (UTC)
Message
Lower sequence triggers are evaluated first.

My first reaction on looking at this is your trigger with sequence 100 enables a trigger group BM which has sequence 50. Is this intentional? It will be too late this time around, as trigger with sequence 50 is tested first, and will not be enabled yet.

I would try to combine the matching for everything that might occur in one line, into one trigger.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shadoweave   (42 posts)  Bio
Date Reply #2 on Fri 14 Dec 2007 07:05 AM (UTC)
Message
Fixed through trial and error, the second trigger should have been keep evaluating too. And the sequence is right, I tried with sequence 100 and it didn't work.
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.


11,069 views.

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

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.