Changing Wordwrap

Posted by Sickent on Tue 03 Sep 2024 01:23 PM — 3 posts, 6,904 views.

USA #0
Hello!

Is there anyway to change the wordwrap without accessing the option manually? I went digging through GetInfo and didn't see it as one of the available options.

To be clear, I'm talking about Appearance > Output > Wrap output at column number:

I just want to know if there's a quick way to make this happen in script. One of the MUSH I play on have outputs they use their own wrapwidth to define.

https://ibb.co/svwQcv6

This is a practical example. I wrap at 120 character currently. WHO wraps at 79. The red circle is an output I generate, and I just want to wrap it for that little section at 79 characters to match everything else.

Thank you!
Australia Forum Administrator #1
Virtually all the client options can be read or updated through scripting. For numeric options see:

Template:function=GetOptionList
GetOptionList

The documentation for the GetOptionList script function is available online. It is also in the MUSHclient help file.





for k, v in pairs (GetOptionList()) do 
  Note (v, " = ", GetOption (v)) 
end


In your case you would see:


...
wrap_column = 120
...


To change that, in Lua you could say:


SetOption ("wrap_column", 79)


Template:function=SetOption
SetOption

The documentation for the SetOption script function is available online. It is also in the MUSHclient help file.



And then put it back to 120 afterwards.

You need to change the wrap column before the text arrives, the wrapping is done on the fly, not retrospectively.

Thus, you could make an alias for WHO that changes the wrap column, and then sends "WHO" to the MUD. Then use a trigger to notice the end of the who list and change the wrap column back.

The trigger to put wrapping back could match on "There are * people total online *" for example.
Amended on Tue 03 Sep 2024 08:53 PM by Nick Gammon
USA #2
That was exactly what I needed. I was looking in the wrong spots for the options. Thank you!