Mudlet doesnt clear screen

Hesk
Posts: 18
Joined: Wed Dec 26, 2018 10:10 pm

Re: Mudlet doesnt clear screen

Post by Hesk » Sat Dec 29, 2018 12:10 pm

Nothing of those gives me the lines of the current screen. Just of the whole buffer.
I need a function which gives me the line-count which are currently displayed.
For example at my screen there are 82 lines displayed.

Is there anything like that?

User avatar
Vadi
Posts: 4666
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet doesnt clear screen

Post by Vadi » Sat Dec 29, 2018 1:21 pm

Yes, get the dimensions of th screen and then divide by the height of a character

Hesk
Posts: 18
Joined: Wed Dec 26, 2018 10:10 pm

Re: Mudlet doesnt clear screen

Post by Hesk » Sat Dec 29, 2018 11:48 pm

Well..actually what i was searching for was : getRowCount()

But it doesnt work.

moveCursor doesnt work either. I move the cursor to line-number - 10 .. but the next content comming from the mud is still appended to the end, not to the cursor position.

Really sad mudlet doesnt seem to be able to handle this.
I just want those 10-15 lines to be shown on the exact position in the main-window, overriding itself

User avatar
Vadi
Posts: 4666
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet doesnt clear screen

Post by Vadi » Sun Dec 30, 2018 8:00 am

Uh yes, content is always appended to the bottom, not where the cursor is. Otherwise, any script could move the cursor and leave it there and mess up the players display. You can see how we're saving people a ton of headaches by doing it the way we do right now.

User avatar
SlySven
Posts: 918
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Mudlet doesnt clear screen

Post by SlySven » Tue Jan 22, 2019 3:41 am

That CSR sequence, like other things like cursor movement are VT100 commands that Mudlet cannot easily handle - they are more suited to a CLI type interface rather than our GUI one because we take the output from the MUD Server line-by-line and pass those lines through our trigger engine system. Cursor movement and screen clearing functionality break such things because it means that the Server is trying to change things that it has already sent to us and we have already processed. As Vadim is proposing, you might be able to detect that CLear Screen command and use it to delete a quantity of existing lines from the displayed text corresponding to the number of rows of text in the current main screen size - though you could also be losing wanted text as well as stuff you want cleared...

User avatar
Zaphob
Posts: 106
Joined: Wed May 09, 2012 8:07 am
Location: mg.mud.de

Re: Mudlet doesnt clear screen

Post by Zaphob » Sat Jan 26, 2019 1:50 am

I for one don't think it needs to be so complicated. Am I too naive here?

When I receive a "clear screen", I would not expect all buffer to go away, but I would like to see black (or whatever your background color is). So to realize this, can Mudlet just "scroll down" so to say?

That is, the latest line is now at the top of the screen, the cursor is right below there, and no other lines follow. When a new line arrives, it will also be printed at the top there, and so on, until at some point the bottom of the screen is reached again, and scrolling may continue.

This seems to be the desired effect. In essence, it is much like the state of Mudlet when you first connect any profile. The window will be black and only little by little are lines appended at the top. If you stop connection quickly enough, not much text is printed at all. It is almost a clear screen at that point.

For the "clear screen" at a later time now, you could theoretically at any point manually scroll up and break the illusion by revealing there is still text before. That seems like a small price to pay, whereas you mostly get the desired effect, and without any actually complicated buffer clearing or cursor movement shenanigans.

User avatar
Vadi
Posts: 4666
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet doesnt clear screen

Post by Vadi » Tue Jan 29, 2019 7:28 am

That seems like a great idea!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 10 guests