Register forum user name Search FAQ

Gammon Forum

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.
 Entire forum ➜ MUSHclient ➜ Tips and tricks ➜ Copying XML

Copying XML

This subject is now closed.     Refresh page


Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Sun 17 Oct 2004 02:30 AM (UTC)

Amended on Mon 18 Oct 2004 06:31 AM (UTC) by Nick Gammon

Message

MUSHclient supports the use of XML on the clipboard for copying and pasting triggers, aliases, timers and so on.

This example shows how to go about using that.

Create a trigger in the trigger configuration list:

Close the trigger window, and then in the trigger *list* window you will see a "copy" button. Click that:

On your clipboard is now a copy of the trigger 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>

You can now paste that into a different MUSHclient world, or email it to someone, paste it into a plugin, or post it onto the forum.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 17 Apr 2007 07:42 AM (UTC)

Amended on Wed 19 Aug 2009 04:07 AM (UTC) by Nick Gammon

Message
Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #2 on Sun 18 May 2008 09:33 PM (UTC)

Amended on Sun 18 May 2008 09:35 PM (UTC) by Nick Gammon

Message
Also be aware that if you are posting triggers (or aliases/timers) onto this forum, and using Forum Codes, then you need to be aware that the forum converts certain formatting sequences (like [i] for italics, [quote] for quoting, and [code] for code sequences). If you use such things in your trigger/timer/alias they will be mis-displayed.

To avoid this, if you are posting on the forum you should "escape" out square brackets and backslashes. Fortunately MUSHclient gives you a menu item to do just that. See the Edit menu -> Convert Clipboard Forum Codes (Shift+Ctrl+Alt+Q).

So, for posting on the forum do this:


  • Copy the trigger/alias/timer using the Copy button
  • Close the world configuration dialog, so you can use the normal MUSHclient menus
  • Press Shift+Ctrl+Alt+Q to convert Forum Codes - you will get a dialog confirming how many were converted (it might be zero)
  • In your forum posting, type [code]
  • Paste in the converted trigger/alias/timer
  • In your forum posting, type [/code]
  • You are done!


The forum automatically detects the word "[code]" in posts, and turns Forum Codes on for you, so you don't need to manually do it.

The use of Forum Codes, in particular the [code] ... [/code] tag sequence is recommended, as that preserves the spacing of the original. Thus the trigger above, when posted to the forum, should look like this:


[code]
<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>
[/code]


You will only see the forum codes when you make or edit the post, when the post is displayed they disappear because they are being acted upon by the forum.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #3 on Sun 18 May 2008 09:40 PM (UTC)
Message
Note also that because the XML code needs to distinguish between tags like <send> in the trigger, and your possible use of the word "<send>" inside your trigger text, it needs to convert the following:


  • > becomes &gt;
  • < becomes &lt;
  • & becomes &amp;


This conversion is not a bug. If you subsequently paste the copied item back into MUSHclient (see http://mushclient.com/pasting) then they will be converted back.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


32,347 views.

This subject is now closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

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