Page 1 of 2

Mudlet doesnt clear screen

Posted: Wed Dec 26, 2018 10:14 pm
by Hesk
Hello,

i have a small mud which sends CLS (code: ESC+[2J) but mudlet doesnt clear the screen.
In other clients (for example cmud) its working.

Anyone can help?
Thanks

Re: Mudlet doesnt clear screen

Posted: Thu Dec 27, 2018 9:05 am
by Vadi
I don't believe we implement support for that telnet command. You can send in a PR if you'd like, or workaround with some Lua code - hook into sysTelnetEvent to catch it and use clearWindow() to empty the screen.

Re: Mudlet doesnt clear screen

Posted: Thu Dec 27, 2018 11:58 am
by Hesk
Can you give an example maybe?

This doesnt seem to work:

Name: telnetEventHandler
Registered Event Handlers: sysTelnetEvent

function telnetEventHandler(type, option, message)
display("Unhandled event: " .. type .. ":" .. option .. ":" .. message)
end

Thank you

Re: Mudlet doesnt clear screen

Posted: Thu Dec 27, 2018 12:17 pm
by Hesk
Hm..the script is raised when i log in to the mud:

"Unhandled event: 252:1:��"

But is not raised where that CLS is sent. Maybe it is suported but not executed?

Re: Mudlet doesnt clear screen

Posted: Thu Dec 27, 2018 2:34 pm
by Vadi
Not sure. Could you record a replay (casette button bottom-right of the main window) and post it?

Re: Mudlet doesnt clear screen

Posted: Fri Dec 28, 2018 8:29 am
by Hesk
Here is the output from .dat:


æ L[33m[ UNDEFINED !, omountain ][0m[37m src/room/overland#485
ÿúÉHoly._ovl (ÿð[2J[H
[40m[37m[42m[33m.....[40m[37m[40m[37m
[40m[37m[42m[33m....[47m[34m:::::[40m[37m[40m[37m
[40m[37m[42m[33m.[47m[34m:::::[42m[33m.....[40m[37m[40m[37m
[40m[37m[42m[33m..[47m[34m:[42m[33m.........[44m[37m~[40m[40m[37m
[40m[37m[42m[33m..[47m[34m:[42m[33m......[44m[37m~~~~[40m[40m[37m
[40m[37m[47m[34m:::::[44m[37m~~~~~~[42m[33m...[47m[34m:[40m[37m[40m[37m
[40m[37m[44m[37m~[42m[33m.[44m[37m~[41mH[47m[33m=[44m[37m~[42m[33m..[41m[37mTTT[47m[34m::::[40m[37m[40m[37m
[40m[37m[44m[37m~~~[42m[33m.[47m[34m:::[31mX[34m:[41m[37mT[47m[34m::[42m[33m...[40m[37m[40m[37m
[40m[37m[44m[37m~[42m[33m...[47m[34m:[42m[33m..........[40m[37m[40m[37m
[40m[37m[42m[33m...[47m[34m::[42m[33m..........[40m[37m[40m[37m
[40m[37m[47m[34m:::[42m[33m..........[40m[37m[40m[37m
[40m[37m[42m[33m.............[40m[37m[40m[37m
[40m[37m[42m[33m...........[40m[37m[40m[37m
[40m[37m[42m[33m.........[40m[37m[40m[37m
[40m[37m[42m[33m.....[40m[37m[40m[37m


* Y> [0mÿï

The [2J is the CLS.

I also tried with an gmcp-flag (Holy._ovl). That is nearly working. But clearWindow() is too much because it clears everything.
In the mud you ware walking on a map...and i want that map to be on the same position on the screen and not scrolling.
So i need someting like "start at the top of the screen"

Re: Mudlet doesnt clear screen

Posted: Fri Dec 28, 2018 8:48 am
by Hesk
Is is possible to clear the current screen with some combination of moveCursor and deleteLine?

My thinking:
i get the gmcp-signal from the mud that the map comes. i clear the current screen and then the map is shown

Possible?

Re: Mudlet doesnt clear screen

Posted: Fri Dec 28, 2018 9:12 am
by Vadi
Why not just create a miniconsole and show the map there?

Re: Mudlet doesnt clear screen

Posted: Fri Dec 28, 2018 12:06 pm
by Hesk
Would not feel right for this mud.

What i need: how many lines are on the current screen. So i can scroll them away:

function clear()
for i = 1, lines_on_screen, 1 do
echo("\n")
end
end

Is there some way to get the lines on the current screen?

It would work with clearWindow...but then everything is cleared and the user cant scroll up to look at something.

Re: Mudlet doesnt clear screen

Posted: Fri Dec 28, 2018 12:58 pm
by Vadi
Yes - see getLastLineNumber(), getLineCount(), getLineNumber()