Gammon Forum
Entire forum
MUSHclient
Bug reports
Can't disable output wrap
Can't disable output wrap
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Smorly
(31 posts) bio
|
Date
| Sat 09 Feb 2013 06:45 PM (UTC) |
Message
| Unchecking 'wrap output at column number' in world prefs does not disable output window wrapping. The text continues to be wrapped at the value set by the numberpicker.
Auto-wrap also unchecked. | top |
|
Posted by
| Fiendish
USA (2,514 posts) bio
Global Moderator |
Date
| Reply #1 on Sat 09 Feb 2013 06:54 PM (UTC) Amended on Sat 09 Feb 2013 06:55 PM (UTC) by Fiendish
|
Message
| That's actually not quite what that option means, and the option should be renamed to be more clear.
Increase the number instead. |
https://github.com/fiendish/aardwolfclientpackage | top |
|
Posted by
| Smorly
(31 posts) bio
|
Date
| Reply #2 on Sat 09 Feb 2013 06:56 PM (UTC) |
Message
| The maximum line length from the MUD exceeds 500 characters. I need to make it more than 500. | top |
|
Posted by
| Fiendish
USA (2,514 posts) bio
Global Moderator |
Date
| Reply #3 on Sat 09 Feb 2013 06:59 PM (UTC) |
Message
| In this case I will suggest that you are probably wrong.
Disabling wrap entirely is unlikely to ever be the correct choice for usability. Set it to the width of your display so that you can actually read the game output. |
https://github.com/fiendish/aardwolfclientpackage | top |
|
Posted by
| Smorly
(31 posts) bio
|
Date
| Reply #4 on Sat 09 Feb 2013 07:18 PM (UTC) |
Message
| I'm capturing all window output to redirect to various other windows. Due to Python not being conveniently handed a table of colour styles, I have to capture that information myself. Here is my dilemma:
def ccopy(name, line, wildcards):
ln = world.GetLinesInBufferCount
while world.GetLineInfo(ln, 1) != line:
ln -= 1
if ln == 0:
world.Note('Error! Line not found!')
return
When a line is wrapped, the second argument of this function will not match any output lines.
Suggestions? | top |
|
Posted by
| Smorly
(31 posts) bio
|
Date
| Reply #5 on Sat 09 Feb 2013 10:03 PM (UTC) |
Message
| So I have everything else in place to do full colour line capture, except this.
It's unlikely that a player will encounter a line that is long enough to trigger this bug, but it's troubling to have to ship something with a known bug.
The script-side work-around to this is obviously to read how much of the line you got, and read lines forward, appending together the original string, but I'd prefer to run the leaner code. Also, I'm trying to avoid race conditions with the buffer cleanup, so the fewer instructions, the better. Unless MUSHclient guarantees atomicity of the output window while processing a trigger?
Maybe there's a way to do a raw capture, grabbing the line unmolested, ANSI intact? | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #6 on Sat 09 Feb 2013 11:43 PM (UTC) |
Message
| When a trigger matches, it matches the entire line up to the newline. That is, the "line" may be more than one line in the output window.
If you used Lua, there is a 4th argument to the trigger match which is a table of style runs.
If you want to use Python, you are going to have to work backwards to reconstruct the "full" line.
You get use GetLineInfo to do this (read the comments in the help). Basically you read backwards checking the "newline" return (selector 3). That would give you the end of the previous line. Then step forwards one line. You now have the start of the current line. Then read forwards, assembling lines (and colour info) from GetStyleInfo.
Quote:
Maybe there's a way to do a raw capture, grabbing the line unmolested, ANSI intact?
OnPluginPacketReceived callback would do that, but that is rather fiddly. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Smorly
(31 posts) bio
|
Date
| Reply #7 on Sun 10 Feb 2013 12:20 AM (UTC) Amended on Sun 10 Feb 2013 12:21 AM (UTC) by Smorly
|
Message
| Right, so given that I have to do that (as I mentioned above), am I guaranteed atomicity of the output buffer while my trigger is processing?
If not, will there be a race condition to guard against, where the line numbers change in between capturing each line as the result of buffer trimming?
Would be nice if the 0th line was the most recent one, but I know that's not happening ;)
Alternately, could you make an option to disable output wrapping? Better yet, make the colour/style table available to external scripting languages?
Forgot to mention: I already am performing a full ANSI color/style copy to another window, this issue of output wrapping is the last remaining bug. | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #8 on Sun 10 Feb 2013 08:30 PM (UTC) |
Message
| There is no race condition. The trigger fires and handles the most recently received line before anything else is added.
Disabling output wrapping wouldn't be particularly useful for most people.
The method I described for obtaining the style information isn't that fiddly, the client does it itself to assemble the "full line of text" before calling a trigger (so it can pass down the full matching line). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Smorly
(31 posts) bio
|
Date
| Reply #9 on Sun 10 Feb 2013 09:07 PM (UTC) |
Message
| Thanks, that answers it. | 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.
21,661 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.