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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Bug reports ➜ "Copy" bug

"Copy" bug

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


Posted by Terry   USA  (87 posts)  Bio
Date Sun 18 May 2008 05:00 AM (UTC)
Message
I was using the "copy trigger" feature in v4.24 just to test it out. Anyway, it did a weird thing with ==. Instead of it showing up corretly, it copied as ">". Here's the script as how it copied.

<triggers>
  <trigger
   enabled="y"
   match="^(.*?) is now level (.*?)\!\!$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>if %2 &gt; 14 then
  Send ("chat Woo\! Level ", %2, "\! \:D")
end -- if</send>
  </trigger>
</triggers>
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #1 on Sun 18 May 2008 09:07 AM (UTC)
Message
It should be fine again once you paste it in MUSHclient.

XML requires that < (&lt;) and > (&gt;) be escaped, same with some other characters like & (&amp;) and such.
Top

Posted by Terry   USA  (87 posts)  Bio
Date Reply #2 on Sun 18 May 2008 03:30 PM (UTC)
Message
When I copy things into the website, should I edit things that are escaped? Or should I leave them as is? Or is it just personal preference?
Top

Posted by Onoitsu2   USA  (248 posts)  Bio
Date Reply #3 on Sun 18 May 2008 08:21 PM (UTC)
Message
Leave them escaped so that others can just copy and paste it into their mushclients, and try it out.

-Onoitsu2
Top

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

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

Message
As the other posters have said, this is not a bug, it is a feature. ;)

Imagine in your trigger you wanted to say something with < or > symbols in it, like this:


Say ("Woot! </send> I levelled!")


I know this might seem a strange thing to say, but imagine you wanted to.

Now the trigger parser needs to know the difference between the </send> at the end of the "send" text, and a </send> in the middle of it.

Thus it converts it to:


Say ("Woot! &lt;/send&gt; I levelled!")


However if you try to paste the trigger back into MUSHclient (try it, on a different world) then it works symmetrically, and converts the special characters back again.

Since the converted text uses ampersands, they too have to be converted. Thus:


Say ("It is raining cats & dogs")


becomes:


Say ("It is raining cats &amp; dogs")


Quote:

When I copy things into the website, should I edit things that are escaped?


You should leave them as is, or the triggers or whatever they are could become unusable.

However there is a "gotcha" with the forum (that does not apply to simply copying and pasting triggers at home).

If you use square brackets, or backslashes, and are using "forum codes" then they should be escaped. You used the [code] tag in your original post. Imagine what would happen if you had wanted to say:


Say ("Woot! [code] I just levelled!")


The forum would interpret [code] as a forum tag.

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, and if you are using forum codes, 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!


So you would see, in my earlier example, while you are typing in the post:


Say ("Woot! \[code\] I just levelled!")


(I did it twice to show the idea, as doing it once is only visible when you are doing the posting).

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #5 on Sun 18 May 2008 09:41 PM (UTC)
Message
I have amended the forum post http://mushclient.com/copying to explain this stuff for future reference.

- 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.


20,470 views.

It is now over 60 days since the last post. This thread is 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.