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
➜ General
➜ ansi conversion?
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Fiendish
USA (2,555 posts) Bio
Global Moderator |
| Date
| Fri 17 Dec 2010 07:56 AM (UTC) |
| Message
| | Is there a function somewhere for converting ansi embedded strings to style runs? Or maybe an ansi version of WindowText? |
https://github.com/fiendish/aardwolfclientpackage | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Fri 17 Dec 2010 08:13 PM (UTC) |
| Message
| I don't think so. You could write one easily enough depending on what subset of the spec you wanted to support (eg. do you want to support the 256-colour variants?).
It seems odd though that you can't get the MUD to send you the more natural colour codes. A while back for the inventory plugin I thought it was silly for the MUD to read in codes like @G for green, convert them to ANSI (itself some work) and then have the client convert them back before displaying. Thus I got Lasher to simply send me the MUD codes (like @W, @G etc.).
But if that isn't possible, some sort of string.gmatch that pulls out sequences like ESC ... m and then decodes the stuff inside that into individual numbers separated by commas or whatever it is, and then looking them up in a table, should do it.
The general technique is in methods_noting.cpp in the C++ source, function AnsiNote.
However since you are interested in speed, I would try to bypass the whole need for it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Fiendish
USA (2,555 posts) Bio
Global Moderator |
| Date
| Reply #2 on Fri 17 Dec 2010 08:23 PM (UTC) |
| Message
| | Yeah, I guess it's better to just get the MUD to send native color codes instead of ansi sequences. |
https://github.com/fiendish/aardwolfclientpackage | | 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.
9,010 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top