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
➜ Removing newline characters from Mud output
|
Removing newline characters from Mud output
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| hogarius
USA (22 posts) Bio
|
| Date
| Sat 13 Apr 2013 07:56 PM (UTC) |
| Message
| Is it possible to remove newline characters from the text sent to the output window? I want text sent from the MUD as shown below...
The flame tree in the front yard extends one bough, burnished silver by the light of the porch fixture, toward you, shielding you from the night.
You also see a trellis arch, the sidewalk, Genivieve Dallon, a watering can and some low ground cover with bright yellow flowers.
...to show as...
The flame tree in the front yard extends one bough, burnished silver by the light of the porch fixture, toward you, shielding you from the night.You also see a trellis arch, the sidewalk, Genivieve Dallon, a watering can and some low ground cover with bright yellow flowers. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Sun 14 Apr 2013 09:11 AM (UTC) |
| Message
| | You can remove newlines but you don't want all of them removed, right? Otherwise your inventory would come out as a whole lot of gibberish. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| hogarius
USA (22 posts) Bio
|
| Date
| Reply #2 on Sun 14 Apr 2013 03:36 PM (UTC) Amended on Sun 14 Apr 2013 09:02 PM (UTC) by hogarius
|
| Message
| I probably need to explain a little better what I'm looking to do.
Modus Operandi has what are called GSL (GemStone Language) tags, which are markers in the text it sends out. These markers are used in Simutronics' proprietary Wizard client.
The tags are in the following format.
<28>GSx0000000000<CR><LF>
<28> - FS character, decimal 28, hex 1C
GS - constant, stands for GemStone (the original Simutronics text game)
x - 1 character identifier, capital or small letter, indicating what tag this is
00000000000 - alphanumeric data for this tag. Not all tags have this.
<CR><LF> - marks the end of the tag.
Sometimes these tags are on a line by themselves, usually to send out some info on a player's game or connection status.
Sometimes, however, these tags are incorporated in the middle of blocks of text. For example...
This is a passage that contains <28>GSL<CR><LF>bold text<28>GSM<CR><LF> in the middle.
The GSL and GSM tags turn on and turn off bold text.
The problem is that MUSHclient doesn't natively recognize GSL tags as anything special. As a result, MUSHclient interprets the CR and LF characters as a typical new line sequence.
As I think about it more, I'm guessing my triggers that process mid-paragraph GSL tags need to change the CR LF sequence to another character, perhaps # or ` or ~ . The result would be that, in addition to processing the data for the tag, the line with the tag and the following line would be combined together into one line.
I'd appreciate any help or suggestions anyone can provide. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Sun 14 Apr 2013 11:56 PM (UTC) |
| Message
| You can preprocess the incoming lines, some examples here:
http://mushclient.com/forum/?id=7430
One in particular added newlines to prompts. You could just as easily take them away. Of course you need to set up the appropriate conditions, bearing in mind the text in question might span multiple packets. |
- 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.
17,704 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top