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 ➜ AddTrigger question

AddTrigger question

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


Posted by Shady Stranger   USA  (45 posts)  Bio
Date Thu 26 May 2011 03:13 AM (UTC)
Message
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.
Top

Posted by Shady Stranger   USA  (45 posts)  Bio
Date Reply #1 on Thu 26 May 2011 04:22 AM (UTC)

Amended on Thu 26 May 2011 06:07 AM (UTC) by Shady Stranger

Message
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.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #2 on Thu 26 May 2011 10:35 AM (UTC)
Message
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.

- Nick Gammon

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

Posted by Shady Stranger   USA  (45 posts)  Bio
Date Reply #3 on Sat 28 May 2011 01:10 AM (UTC)
Message
Thank you. Works like a charm.
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.


12,998 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.