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
➜ <trigger vs. AddTrigger(...
<trigger vs. AddTrigger(...
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| ProgrammingVerbs
(3 posts) 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 | Top |
|
Posted by
| Magnum
Canada (580 posts) 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. | 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.
11,912 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top