Pasting XML

Posted by Nick Gammon on Sun 17 Oct 2004 02:35 AM — 5 posts, 48,501 views.

Australia Forum Administrator #0

See further down for a video podcast demonstrating how to do this.

You may see on the forum, in emails, or elsewhere, triggers, aliases or timers in XML format, like this:


<triggers> <trigger custom_colour="2" enabled="y" group="eat_drink" match="You are thirsty." name="thirst_trigger" sequence="100" > <send>get flask bag drink flask put flask bag</send> </trigger> </triggers>

To use them copy the entire text (from, and including <triggers> ... </triggers>) to the Windows clipboard. (Or, <aliases> or <timers> as the case may be).

Important: - the <triggers> line is required (and the corresponding </triggers> line).

Then go into the MushClient triggers configuration window (if you have a trigger on the clipboard), and click the "Paste" button, like this:

The trigger will now be pasted into the trigger list, and you can edit it:

Once you edit it you will see the trigger as if you had entered it yourself:

Amended on Tue 25 May 2010 05:43 AM by Nick Gammon
Australia Forum Administrator #1

An alternative method of pasting, which may save a couple of keystrokes, and which is useful if you have triggers and aliases to be pasted, is to use the File -> Import menu.

You will see a dialog like this:

The "Clipboard" button will be greyed out if there is no valid XML information on the clipboard.

Simply click on the "Clipboard" button and you will see a confirmation dialog of how many triggers, aliases, timers etc. were imported, like this:

Australia Forum Administrator #2
If the trigger (or alias, or timer) does a "send to script" then you also need to ensure that scripting is enabled.

You can tell by looking next to the "Send to:" label in the trigger/alias/timer. If you see the word "Script" then it is using scripting.

To enable scripting go to the World Configuration dialog -> Scripting section, and check the "Enable Script" checkbox.

Template:scripting
Scripting tutorial

There is extensive information about scripting in MUSHclient at http://mushclient.com/scripting. This includes screen shots and examples.



You also need to check that the appropriate script language is selected. Nowadays a lot of scripts use Lua, but if you are in doubt read the forum posting for a clue about the script language.
Amended on Wed 19 Aug 2009 04:09 AM by Nick Gammon
Australia Forum Administrator #3
Template:copying
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
Amended on Wed 19 Aug 2009 04:07 AM by Nick Gammon
Australia Forum Administrator #4

Below is a one-minute podcast that shows how to copy from a forum page and paste into MUSHclient:

You can download and save a larger version of the podcast to your computer by RH-clicking on Copying triggers etc. from the forum and pasting into MUSHclient (1.6 Mb). Video files should be playable by programs such as VLC.

Embedded <video> tags (which are used by this post) are supported now by major web browsers. Minimal versions for such support are:

  • Chrome 4.0
  • Internet Explorer 9.0
  • Firefox 3.5
  • Safari 4.0
  • Opera 10.5