I want turn off all trigger but trigger one. which function is used? thank.
How can I turn off all the trigger?
Posted by Tianxz on Wed 19 May 2010 05:44 PM — 6 posts, 26,241 views.
You could make an alias that does this in "send to script":
That loops through all triggers, turning them all of except "t1".
You would need another, similar, alias to turn them all on again.
Alternatively you could put your triggers into groups (type a name in the group field), and then enable and disable whole groups.
triggerlist = GetTriggerList()
if triggerlist then
for k, v in ipairs (triggerlist ) do
if v ~= "t1" then
EnableTrigger (v, false)
end -- if
end -- for
end -- if we have any triggers
That loops through all triggers, turning them all of except "t1".
You would need another, similar, alias to turn them all on again.
Alternatively you could put your triggers into groups (type a name in the group field), and then enable and disable whole groups.
thank you. I got it even i use the php.
1) And how about just some of them, not all the trigs but only those I have selected to only run when nothing critical happens? NO, DO NOT advice me to disable them manually - I got about 10 secs to do it - and after that they must be turned off - or my char will die. I'm in a hurry to even press one key on the keyboard and don't got the time to turn trigs of.
I have myself figured out that my trig would do this automatically itself, by firstly checking if it is enabled (enabled by another trig or an alias). This other trig or alias sets a variable to a value of f.ex. "ON". The main trig will after this work but only if this variable has been preset to the value "ON". If it has another value it will do nothing and the trig will not work - which is what I want.
Now, how do one control flow in a trig? How do I write the trig:
If MyTrig == "ON"
DoIt
else
DoNothing
Is an else-clause needed, btw. or can it be left out?
2) How do I make the trig (or alias) that sets the variable to be tested. Is the SetVariable function available? Could an alias do it (like typeing "stop" - it can of course be done a bit clumsily by a trig that watches for me <saying "stop">) - I can of course make the alias for <say stop> but it is kind of clumsy).
Secondly, I'd like to have a trig which, if it is set to ON displays a message (changing the original message received from the MUD). Else, that is if it is set to OFF, it increases a counter and suppresses the original message. The counter is then zeroed when the trig is turned ON. How can this be done?
Rgds
Mazarin, MUSH-newbie
I have myself figured out that my trig would do this automatically itself, by firstly checking if it is enabled (enabled by another trig or an alias). This other trig or alias sets a variable to a value of f.ex. "ON". The main trig will after this work but only if this variable has been preset to the value "ON". If it has another value it will do nothing and the trig will not work - which is what I want.
Now, how do one control flow in a trig? How do I write the trig:
If MyTrig == "ON"
DoIt
else
DoNothing
Is an else-clause needed, btw. or can it be left out?
2) How do I make the trig (or alias) that sets the variable to be tested. Is the SetVariable function available? Could an alias do it (like typeing "stop" - it can of course be done a bit clumsily by a trig that watches for me <saying "stop">) - I can of course make the alias for <say stop> but it is kind of clumsy).
Secondly, I'd like to have a trig which, if it is set to ON displays a message (changing the original message received from the MUD). Else, that is if it is set to OFF, it increases a counter and suppresses the original message. The counter is then zeroed when the trig is turned ON. How can this be done?
Rgds
Mazarin, MUSH-newbie
Put the ones you want to disable into a group (type some word like "non combat" into the Group field for each trigger). Then make an alias to EnableTriggerGroup (search the forum, there have been a few posts about such an alias).
Then you can make a macro (eg. F5) which calls the alias, so F4 could disable all those triggers, and F4 enable them again.
Then you can make a macro (eg. F5) which calls the alias, so F4 could disable all those triggers, and F4 enable them again.
Please see the forum thread: http://gammon.com.au/forum/?id=8713.