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 ➜ controlling triggers from the world command line

controlling triggers from the world command line

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


Posted by Mork451   USA  (6 posts)  Bio
Date Wed 06 Aug 2003 08:22 PM (UTC)
Message
Call me hopeless, but I can't seem to get a handle on how to turn a trigger on or off from the mushclient world command line. For instance, I have a trigger labelled 'loot'. There are times I need to disable it FAST...i.e., no time to open the menu with a right-click, select triggers, scroll down to the right trigger, etc....you get the picture. What exactly must I type on the command line to disable (not delete) that specific trigger?
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 06 Aug 2003 08:31 PM (UTC)
Message
To do it without any preparation, and assuming scripting is active, do this:


/world.enabletrigger "loot", 0


However you will probably say that is too much typing. So, make an alias "lootoff" and another called "looton", like this:


<aliases>
  <alias
   match="lootoff"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>enabletrigger "loot", 0
note "** looting off **"</send>
  </alias>

  <alias
   match="looton"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>enabletrigger "loot", 1
note "** looting ON **"</send>
  </alias>
</aliases>



- Nick Gammon

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

Posted by Mork451   USA  (6 posts)  Bio
Date Reply #2 on Wed 06 Aug 2003 08:38 PM (UTC)
Message
Thanks, I got all of that except the 'send_to: "12"' part
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 06 Aug 2003 08:43 PM (UTC)
Message
You can just copy between the lines, go into alias configuration and hit the paste button. No typing needed. However, the "send to 12" means "send to script".

- Nick Gammon

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

Posted by Mork451   USA  (6 posts)  Bio
Date Reply #4 on Wed 06 Aug 2003 08:52 PM (UTC)
Message
Ah, got it...thanks! Its working! :)


John
Top

Posted by Minaku   (1 post)  Bio
Date Reply #5 on Fri 08 Aug 2003 02:28 AM (UTC)
Message
Okay, so what about for those of us who can't script worth a darn but have set up an intricate system of aliases/triggers? I would love to be able to toggle triggers off and on from the command prompt but am kind of unwilling to learn how to write scripts to do it. Is there a way?
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #6 on Fri 08 Aug 2003 07:07 AM (UTC)
Message
It isn't that hard to do one-line scripts, however the aliases below will do it for you. Copy from between the lines, go into the alias configuration screen, and click the "paste" button.



<aliases>
  <alias
   match="trigoff *"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>if enabletrigger ("%1", 0) = 0 then
  colournote "white", "green", "Trigger %1 now OFF"
else
  colournote "white", "red", "Trigger %1 does not exist"
end if</send>
  </alias>
  <alias
   match="trigon *"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>if enabletrigger ("%1", 1) = 0 then
  colournote "white", "green", "Trigger %1 now on"
else
  colournote "white", "red", "Trigger %1 does not exist"
end if</send>
  </alias>
</aliases>



This will give you two aliases "trigon" and "trigoff". You would use them like this:

trigon attack
trigoff eat

That is, you type "trigon" (trigger on) followed by the name of the trigger you want to turn on, and "trigoff" (trigger off) followed by the name of the trigger you want to turn off.

You will get a message echoed on your screen telling you whether or not the trigger is now on or off, or if it does not exist.

To make this work, the triggers that you are turning on and off must have a label (name) which you put in the "label" box for each one.

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


18,468 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.