Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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.
 Entire forum ➜ MUSHclient ➜ General ➜ Changing Wordwrap

Changing Wordwrap

You need to log onto the forum to reply or create new threads.

  Refresh page


Posted by Sickent   USA  (12 posts)  Bio
Date Tue 03 Sep 2024 01:23 PM (UTC)
Message
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!
Top

Posted by Nick Gammon   Australia  (23,070 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 03 Sep 2024 08:22 PM (UTC)

Amended on Tue 03 Sep 2024 08:53 PM (UTC) by Nick Gammon

Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Sickent   USA  (12 posts)  Bio
Date Reply #2 on Tue 03 Sep 2024 11:48 PM (UTC)
Message
That was exactly what I needed. I was looking in the wrong spots for the options. Thank you!
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.


380 views.

You need to log onto the forum to reply or create new threads.

  Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.