[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  controlling triggers from the world command line
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

controlling triggers from the world command line

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


Posted by Mork451   USA  (6 posts)  [Biography] 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?
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] 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
[Go to top] top

Posted by Mork451   USA  (6 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] 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
[Go to top] top

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


John
[Go to top] top

Posted by Minaku   (1 post)  [Biography] 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?
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] 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
[Go to top] 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.


4,411 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]