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 ➜ How can I turn off all the trigger?

How can I turn off all the trigger?

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


Posted by Tianxz   (30 posts)  Bio
Date Wed 19 May 2010 05:44 PM (UTC)
Message
I want turn off all trigger but trigger one. which function is used? thank.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 19 May 2010 09:14 PM (UTC)
Message
You could make an alias that does this in "send to script":


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.

- Nick Gammon

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

Posted by Tianxz   (30 posts)  Bio
Date Reply #2 on Wed 19 May 2010 10:40 PM (UTC)
Message
thank you. I got it even i use the php.
Top

Posted by Mazarin   (14 posts)  Bio
Date Reply #3 on Sun 23 May 2010 06:17 PM (UTC)
Message
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

Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #4 on Mon 24 May 2010 03:23 AM (UTC)
Message
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.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #5 on Mon 24 May 2010 03:57 AM (UTC)
Message
Template:post=8713 Please see the forum thread: http://gammon.com.au/forum/?id=8713.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


19,935 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.