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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  <trigger vs. AddTrigger(...

<trigger vs. AddTrigger(...

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


Posted by ProgrammingVerbs   (3 posts)  [Biography] bio
Date Sat 22 Mar 2003 09:30 AM (UTC)
Message
When do i use <trigger and when do i use AddTrigger(

example By what name do you wish to be known?
triggers Teak

thanks
[Go to top] top

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #1 on Sat 22 Mar 2003 04:27 PM (UTC)
Message
It depends on the timing of when you would like to create a trigger.

<triggers>
  <trigger
   enabled="y"
   name="NamePrompt"
   match="By what name do you wish to be known?"
   sequence="100"
  >
  <send>Teak</send>
  </trigger>
</triggers>

That code above is a trigger, quoted using XML formatting. Current versions of MUSHclient store the data for your World in an XML formatted file. Plugin files are also formatted in XML.

You can open your world file or a plugin file in a text editor and you will notice the coding convention in use.

Now, most people don't edit their world file directly. Instead, a user can use the GUI configuration tool to establish their settings, including aliases and triggers.

Plugins, currently, don't have their own GUI tool. (Well, not for editing an existing plugin). Working with Plugin files directly using a text editor is fairly common for some of us programmers.

MUSHclient allows you to quote aliases and triggers, and copy and paste them using XML formatting. For example, if you would like to post one of your triggers to the forum here, then you could: Go to your World-Triggers screen in MUSHclient, highlight the trigger, then press the "Copy" button. MUSHclient places the XML code for the trigger into Window's clipboard. You could them "Paste" the XML code here in the forums. Another user could "Copy" the code here from the forums, them go into MUSHclient and "Paste" the trigger into their world.

Using the same methodology, a programmer might take a trigger from their main world, "Copy" it to the clipboard, and then "Paste" the code directly into a plugin file, which they are viewing with a text editor.

Ok, now about "AddTrigger":

"AddTrigger" is a MUSHclient scripting function. You would only see this used in two places: Either in a script file, or directly in the MUSHclient command box.

As I said in the other thread, you can read this page to learn more about that function:
http://www.gammon.com.au/scripts/function.php?name=AddTrigger

For example, you could type the following at the MUSHclient Command Line to add the same trigger I quoted above:
(VBS Version)

/World.AddTrigger "NamePrompt", "By what name do you wish to be known?", "Teak", 0, -1, 0, "", ""

This function is particularly useful when you want to add a temporary trigger via scripting (which you will delete later), or when you want to add a new trigger via scripting that is based on some kind of variable data.

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[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.


10,362 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 HostDash]