Posted by
| Magnum
Canada (580 posts) bio
|
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 |
|