Triggers not firing anymore

Posted by Shadoweave on Tue 27 Nov 2007 12:14 AM — 5 posts, 19,498 views.

#0
Hello, I have this weird problem with my triggers, they don't fire anymore when I use the test trigger window, and they used. If I remove the start new line character ("^"), they seem to fire. The weirdest one is by far this one:

<trigger
   enabled="y"
   group="Cond"
   match="^You are carried off to the (up|down|in|out|east|west|north|south|northeast|nortwest|southeast|southwest)\.$"
   name="charge_carried"
   omit_from_output="y"
   regexp="y"
   send_to="14"
   sequence="100"
  >
  <send>syswarn ("charged to the %1")
</send>
  </trigger>

It triggers on the line "You are carried off to the up." (For the simmulate input window). If I use another direction, it doesn't fire. If I remove the "^" character it fires. What is the problem? I've tried reinstalling MUSH, but it doesn't work. Any ideas?
Australia Forum Administrator #1
It works for me. I suggest you try turning on Game menu -> Trace.

Another trigger with the words east/west/north etc. in it may be firing first.
Australia Forum Administrator #2
However note that if you have "omit from output" set you will also omit the trace output.

If you make a small plugin as shown below, and install it, then trace output will go to a notepad window, and still appear, even if "omit from output" is active:


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, November 27, 2007, 1:29 PM -->
<!-- MuClient version 4.15 -->

<!-- Plugin "Trace_To_Notepad" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Trace_To_Notepad"
   author="Nick Gammon"
   id="85d6ec52237496bd38df9e49"
   language="Lua"
   purpose="Outputs trace information to a notepad window"
   date_written="2007-11-27 13:27:23"
   requires="3.68"
   version="1.0"
   >
</plugin>

<!--  Script  -->

<script>
function OnPluginTrace (line)
  AppendToNotepad ("Trace", line .. "\r\n")
end
</script>

</muclient>



Copy between the lines, save as Trace_To_Notepad.xml, and then use the File menu -> Plugins to install that file as a plugin.
Amended on Tue 27 Nov 2007 01:32 AM by Nick Gammon
#3
Thank you very much, you were right, I had other triggers with the directions that triggered, and now is fixed. Is this normal? I mean, the only resemblance between the pattern was the direction, why did they match anyway?
Ah, and Trace is great, I will get to using the plugin as soon as I can.

EDIT: It works great, just what I was needing, thank you again.
Amended on Tue 27 Nov 2007 12:34 PM by Shadoweave
Australia Forum Administrator #4
Quote:

I had other triggers with the directions that triggered, and now is fixed. Is this normal?


Yes, it is normal to do that. MUSHclient matches the first trigger (based on sequence number of the trigger) and if it matches stops processing further ones. This is intentional, so you can make one trigger match in preference to another one.

However if you check "keep evaluating" then the first trigger match does not stop further evaluating, so you have control over it.

If two triggers have the same sequence number then the order of evaluation is not defined, so if the order is important, make sure you use different sequence numbers.