triggers on/off

Posted by Firgin on Fri 30 Apr 2004 05:19 PM — 9 posts, 30,485 views.

#0
is it any way to make a trigger to turn of a group or triggers? or an alias..
-thanks
USA #1
World.EnableTrigger [triggername], 0
World.EnableTriggerGroup [groupname], 0
World.EnableGroup [groupname], 0
World.EnableAlias [aliasname], 0

The names all have to be strings, so if youre just disabling something, youll need quotes, if youre using a pointer, youll just need the variable, assuming its a string.

In most cases you can ditch the "world." and simply use "EnableTrigger [triggername], 0".
Amended on Fri 30 Apr 2004 06:06 PM by Flannel
#2
eh? is it possible in any other way? you really got me there... *shrug*
thanks though.
USA #3
Alright, The first of these turns off a trigger named "yourtriggername" when you type "triggeroff", the second you type triggeroff [trigger], and it will turn off the trigger with the corresponding name.

You can copy the whole thing (<aliases> to </aliases>) and then click paste on the alias screen and theyll be added.
As seen here:
http://www.gammon.com.au/images/alias_paste.gif

<aliases>
<alias
match="^triggeroff$"
enabled="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>enabletrigger &quot;YourTriggerName&quot;, 0</send>
</alias>
<alias
match="^triggeroff (\w+)$"
enabled="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>enabletrigger %1, 0</send>
</alias>
</aliases>


If you want a trigger to do it, then you would have a trigger with the same thing, youd send to : script, and then have that same send string.

If you wanted to manipulate a group, or an alias (turn a group or an alias off) then youd change the send text appropriately (see my last post).

If you want to post less general things, I can show you more definately.
Australia Forum Administrator #4
Quote:

<send>enabletrigger %1, 0</send>


You need to quote the argument, like this:

<send>enabletrigger "%1", 0</send>
Australia Forum Administrator #5
A simple, one-off, way to do it is to simply type the command in the command window. eg.


/EnableGroup "mygroup", 1


  • The "/" is the "script escape" character (assuming you have enabled scripting and not changed it to something else.
  • The EnableGroup command enables a group.
  • "mygroup" is the name of it (which you set when entering triggers)
  • "1" means "true" (ie. enabled, rather than disabled)


Use this to disable them:


/EnableGroup "mygroup", 0


Then, as Flannel was saying, you can make an alias to automate the process a bit.
Amended on Sun 02 May 2004 09:51 PM by Nick Gammon
#6
Woot! Thank you, I love you guys :P
#7
one more thing.. is it possible in any way to send to two places, like if I want to send to word, and script, what do I do? with the same trigger message of course.. I've tried making two triggers, but only one of them trigger.
USA #8
You can either have the script have a "world.send" (or just send as it doesnt need the world.), or you can use the script escape. The former is the recommended, so you'd send to script:

EnableTrigger "Trigger", 0
Send "This Text Goes to Mud"

Youre really only sending to one place, but then youre having the script send to the world.

And, if you do have two triggers, they will work, you just need to check the 'keep evaluating' box, that will make the line go through the rest of the triggers. However, that requires two triggers, and if you want to change the text, youd have to change both, so this way is a lot easier, for numerous reasons.