AddTrigger question

Posted by Shady Stranger on Thu 26 May 2011 03:13 AM — 4 posts, 16,489 views.

USA #0
Quote:

AddTrigger("monster", "* attacks", "flee", trigger_flag.Enabled , custom_colour.Custom15, 0, "", "")


The script name is optional.

The trigger flags are built into the "trigger_flag" table, as follows:

Enabled = 1
OmitFromLog = 2
OmitFromOutput = 4
KeepEvaluating = 8
IgnoreCase = 16
RegularExpression = 32
ExpandVariables = 512
Replace = 1024
Temporary = 16384
LowercaseWildcard = 2048
OneShot = 32768


How do I add more than one "trigger_flag?" I would like to enable, omitfromoutput and temporary.

Thank you.
USA #1
I believe I have worked out the answer to my original question:
EDIT: I was wrong, this is not working. I don't think it is recognizing all of the trigger_flags.


<aliases>
  <alias
   match="omit *"
   enabled="y"
   send_to="12"
   keep_evaluating="y"
   sequence="100"
  >
  <send>AddTrigger ("Omit", "*%1*", "",
   trigger_flag.Enabled,
   trigger_flag.OmitFromOutput,
   trigger_flag.Temporary,
   trigger_flag.KeepEvaluating,
 custom_colour.NoChange, 0, "", "")</send>
  </alias>
</aliases>


I need to delete this temporary trigger and have tried the following but it doesn't remove the trigger:


<aliases>
  <alias
   match="omitoff"
   enabled="y"
   send_to="12"
   keep_evaluating="y"
   sequence="100"
  >
  <send>DeleteTemporaryTriggers ()</send>
  </alias>
</aliases>


Thank you.
Amended on Thu 26 May 2011 06:07 AM by Shady Stranger
Australia Forum Administrator #2
You have to add or "or" the flags together. They are not separate arguments.

So instead of:


trigger_flag.Enabled,
   trigger_flag.OmitFromOutput,
   trigger_flag.Temporary,
   trigger_flag.KeepEvaluating,


you do:


trigger_flag.Enabled +
   trigger_flag.OmitFromOutput +
   trigger_flag.Temporary +
   trigger_flag.KeepEvaluating,


Since the Temporary flag was not actually processed, it won't be a temporary trigger.
USA #3
Thank you. Works like a charm.