Gammon Forum
Entire forum
MUSHclient
General
Triggers and word wrapping
Triggers and word wrapping
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Ked
Russia (524 posts) bio
|
Date
| Sun 26 Oct 2003 05:39 PM (UTC) |
Message
| The question is difficult to formulate... Suppose the mud sends me a string of text that is formatted using spaces to be split into two separate lines on my screen. Is there any known or hypothetically possible way of using triggers to identify such lines and get a hold of them? Would something like PacketRecieved work here? More specifically - is there any way to tell if the newline was sent by the mud or the client inserted it itself? | top |
|
Posted by
| Flannel
USA (1,230 posts) bio
|
Date
| Reply #1 on Mon 27 Oct 2003 12:43 AM (UTC) |
Message
| Clients dont add a "newline" the text just wraps... it doesnt do a newline for trigger purposes
So, you could probably just do a trigger with the right number of spaces... but, from your description, its sort of hard to know for sure. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | top |
|
Posted by
| Meerclar
USA (733 posts) bio
|
Date
| Reply #2 on Mon 27 Oct 2003 07:36 AM (UTC) |
Message
| Typically, muds are very picky about where and when a newline will be inserted in text. If you are dealing with area descriptions the linebreak is traditionally held at 80 characters but if the descs arent hard-broken your client will wrap them at whatever column width you tell it to - default for most is 80. I've found that on a 1024x768 monitor size I can reliably change linewrap to anywhere between 125 and 140 without difficulty but the hard-broken descriptions will still break at 80 chars. Odds are if you are dealing with chat or other player input, you simply have linewraps because few if any players can judge 80 characters by sight (I've been mudding for longer than I'll admit and still can't eyeball 80 chars reliably). Doesn't really answer the question at hand but might be useful for helping determine if you have a newline or a linewrap "on the fly". |
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org | top |
|
Posted by
| Ked
Russia (524 posts) bio
|
Date
| Reply #3 on Mon 27 Oct 2003 01:33 PM (UTC) |
Message
| Hmmm. Is there an actual 'linewrap' character, or is it the same newline? | top |
|
Posted by
| Nick Gammon
Australia (22,973 posts) bio
Forum Administrator |
Date
| Reply #4 on Sun 02 Nov 2003 07:59 PM (UTC) |
Message
| MUSHclient does not insert newlines, so the question of detecting a "real" one does not exist (or it does exist I suppose, but the answer is you don't need to).
What MUSHclient does is quite simple - when wordwrapping it simply takes the final space and puts it at the start of a new line, thus indenting the paragraphs by a single character. You can use GetLineInfo:
http://www.gammon.com.au/scripts/doc.php?function=GetLineInfo
This returns a flag that says if the line has a newline on it. |
- 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.
10,728 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.