Overriding a trigger

Posted by Gore on Wed 04 Apr 2007 04:29 AM — 9 posts, 33,104 views.

#0
<triggers>
  <trigger
   group="skills-tarot-creator"
   match="^(.*?)$"
   name="ignore_creator"
   omit_from_log="y"
   omit_from_output="y"
   regexp="y"
   send_to="14"
   sequence="2"
  >
  <send>ColourNote ('dimgray', 'white', 'Creator:%1')</send>
  </trigger>
  <trigger
   group="skills-tarot-creator"
   match="(.*?)h\, (.*?)m"
   name="ignore_off"
   regexp="y"
   send_to="14"
   sequence="1"
  >
  <send>EnableTriggerGroup ('skills-tarot-creator', false)</send>
  </trigger>
</triggers>


Can anyone tell me why when ignore_creator is enabled, the omitted lines still fire triggers from a plugin of mine?
USA #1
I'm not quite sure what you're asking about here. Could you post an example of the output from the mud that you expect triggers to fire on correctly, but they don't?

If what I'm thinking you're asking about is correct though, omitting output does not interfere with a trigger from firing. I have several triggers in various plugins that fire from the same omitted line.
#2
Correct, is there anyway to prevent them from firing without actually affecting them at all?
USA #3
Turning them off is the only way I can think of. And you seem to be doing that with the EnableTriggerGroup call. The only thing i can suggest is to make sure that the script ends up disabling the triggers.

Another question I thought of though... Are the triggers that are tripped in the plugin in the same plugin as the triggers you posted here? If they are not in the same plugin, they will not be able to affect each other, since it's in effect a different system. You might have to shut them off with a CallPlugin call.
#4
No, the triggers that I don't want firing are every affliction trigger in my healing system. The trigger that I had hoped would override it was the (.*?) trigger heh.
Australia Forum Administrator #5
The simplest thing might be to disable the plugin, see:

http://www.gammon.com.au/scripts/doc.php?function=EnablePlugin

Then, no triggers in it will fire.
USA #6
Or if it's in the same plugin (or just part of a bigger plugin), just set up a quick script function to disable them one at a time or as a group if they can be clumped together. I've had plenty of weird looking scripts that just turn various triggers on and off.

function init()
  EnableTrigger("qcompletecatcher", false)
  EnableTrigger("notQuesting", false)
  EnableTrigger("tierqpcatcher", false)
  EnableTrigger("luckyqpcatcher", false)
  EnableTrigger("tpcatcher", false)
  EnableTrigger("mccpqpcatcher", false)
  EnableTrigger("anyLine", false)
  EnableTrigger("traincatcher", false)
  EnableTrigger("praccatcher", false)
  gains = {
    ["qp"] = 0,
    ["tp"] = 0,
    ["train"] = 0,
    ["prac"] = 0
  }
end -- init

That just runs through making sure that nothing is triggered to start with aside from the initial trigger, which never gets turned off within the plugin. The whole set of triggers can with a quick command if I decide I don't want my quests tracked at all for a while.
Australia Forum Administrator #7
You could probably save a bit of repetition by making a table of things you want to disable. Then the same table could be used to enable them later.


for _, name in ipairs {
 "qcompletecatcher",
 "notQuesting", 
 "tierqpcatcher", 
 "luckyqpcatcher", 
 "tpcatcher", 
 "mccpqpcatcher", 
 "anyLine",
 "traincatcher", 
 "praccatcher",
} do EnableTrigger (name, false) end

USA #8
I converted that from Jscript to Lua on the first day that I was learning Lua, so I didn't know about Lua's weird little tricks about applying a whole table to a function. Also, these functions are turned on one by one laster in the script, so it's not terribly efficient to keep them clumped together.