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 ➜ Suggestions ➜ world.substitute() method

world.substitute() method

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


Pages: 1  2 

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #15 on Sat 27 Jun 2009 02:44 AM (UTC)

Amended on Sat 27 Jun 2009 02:45 AM (UTC) by Nick Gammon

Message
Aha. The line in question was indeed a bit unusual. :-)

See this:


oints..[4z<BR>Yo   6f 69 6e 74 73 2e 1b 5b 34 7a 3c 42 52 3e 59 6f


This MUD is not sending the normal newline character but instead sending <BR> - I presume it is using MXP or Pueblo.

You have found a bug in MUSHclient where, if it gets <BR> it indeed starts a new line, but marks the new line as a "note" line (the same type as the previous line), which stops the trigger matching, as you surmised.

That will be fixed in version 4.42, but meanwhile the small plugin below seems to fix it, at least for the packet I tested it on.

Copy between the lines, and paste into a text document called Convert_BR_to_newline.xml.

Then use the File menu -> Plugins to install that for this particular world. What it does is convert <BR> to actual \n characters, so then the trigger matching works.



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>

<muclient>
<plugin
   name="Convert_BR_to_newline"
   author="Nick Gammon"
   id="a21640627ddd088ebb72980d"
   language="Lua"
   purpose="Converts <BR> to newlines when in MXP mode"
   date_written="2009-06-27 12:40"
   requires="3.67"
   version="1.0"
   >

</plugin>


<!--  Script  -->


<script>
<![CDATA[
function OnPluginPacketReceived (s)
  if GetInfo (104) or GetInfo (105) then  -- MXP or Pueblo active
    return (string.gsub (s, "<BR>", "\n"))
  else
    return s
  end -- if
end -- OnPluginPacketReceived 
]]>
</script>


</muclient>


- Nick Gammon

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

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #16 on Sat 27 Jun 2009 02:55 AM (UTC)
Message
Should you match on "<BR>" or "\1b[4z<BR>"?

Will "<ESC>[4z<Newline>" cause problems for the MXP parsing?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #17 on Sat 27 Jun 2009 03:12 AM (UTC)
Message
I think the "z" terminates the MXP telnet code, so that should be OK.

- Nick Gammon

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

Posted by Coderunner   USA  (27 posts)  Bio
Date Reply #18 on Sat 27 Jun 2009 03:53 AM (UTC)
Message
Awesome. This works perfectly. It'll be great when version 4.42 comes out, but this works for now.

Thanks Nick, and everyone else who contributed!
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.


60,865 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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.