Greetings folks.
I'm playing an LP-based mud that for whatever reason doesn't seem to understand that clients can do their own wordwrapping and formatting. Consequently, it requires players to specify linelengths, etc, rather than just sending a burst of unformatted text. That results in long lines of text being broken up by new line characters, which are very difficult to deal with in triggers.
I, for example, can't gag these blocks of text properly. It is, therefore, a bit of a nightmare to gag undesired blocks of text, or to replace them with something more brief.
This mud does permit me to set the line length to 999, but doing so pads a boat load of white spaces to the end of the lines.
Do you guys know of a convenient way for me to trim these white spaces from the incoming packets of data? I know there's a trim function, but the OnPluginLineReceived function help text seems to imply that I can't modify the line, just toggle whether or not it's displayed. I took a look at OnPluginPacketReceived, but I don't know that Trim would work line-by-line on a received block of text. Furthermore, the help text seems to imply that modifying packets in this way could break compressed data from the mud.
I've tried modifying it with a regexp pattern, but it doesn't seem to work. ^s*(S+)s*$ doesn't seem to match these white-space heavy blocks.
I've asked the implementor if he'd consider changing how the mud outputs text so that this specific screen size setting isn't required, but he seems to think it'd be more trouble than it's worth.
Here's a packet debug post of just one line of text. By the way, I wish we had a spoilers type of forum code, so I could hide the packet debug spam below, so that those who are interested would be able to click it to display it, but those uninterested wouldn't have to see this wall.
I'm playing an LP-based mud that for whatever reason doesn't seem to understand that clients can do their own wordwrapping and formatting. Consequently, it requires players to specify linelengths, etc, rather than just sending a burst of unformatted text. That results in long lines of text being broken up by new line characters, which are very difficult to deal with in triggers.
I, for example, can't gag these blocks of text properly. It is, therefore, a bit of a nightmare to gag undesired blocks of text, or to replace them with something more brief.
This mud does permit me to set the line length to 999, but doing so pads a boat load of white spaces to the end of the lines.
Do you guys know of a convenient way for me to trim these white spaces from the incoming packets of data? I know there's a trim function, but the OnPluginLineReceived function help text seems to imply that I can't modify the line, just toggle whether or not it's displayed. I took a look at OnPluginPacketReceived, but I don't know that Trim would work line-by-line on a received block of text. Furthermore, the help text seems to imply that modifying packets in this way could break compressed data from the mud.
I've tried modifying it with a regexp pattern, but it doesn't seem to work. ^s*(S+)s*$ doesn't seem to match these white-space heavy blocks.
I've asked the implementor if he'd consider changing how the mud outputs text so that this specific screen size setting isn't required, but he seems to think it'd be more trouble than it's worth.
Here's a packet debug post of just one line of text. By the way, I wish we had a spoilers type of forum code, so I could hide the packet debug spam below, so that those who are interested would be able to click it to display it, but those uninterested wouldn't have to see this wall.
.. Buy a com 0d 0a 20 20 20 20 20 42 75 79 20 61 20 63 6f 6d
mand using your 6d 61 6e 64 20 75 73 69 6e 67 20 79 6f 75 72 20
available comman 61 76 61 69 6c 61 62 6c 65 20 63 6f 6d 6d 61 6e
d points. 64 20 70 6f 69 6e 74 73 2e 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20