Mudlet doesnt clear screen

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

Mudlet doesnt clear screen

Post 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

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

Re: Mudlet doesnt clear screen

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

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

Re: Mudlet doesnt clear screen

Post 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

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

Re: Mudlet doesnt clear screen

Post 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?

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

Re: Mudlet doesnt clear screen

Post by Vadi »

Not sure. Could you record a replay (casette button bottom-right of the main window) and post it?

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

Re: Mudlet doesnt clear screen

Post 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"

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

Re: Mudlet doesnt clear screen

Post 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?

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

Re: Mudlet doesnt clear screen

Post by Vadi »

Why not just create a miniconsole and show the map there?

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

Re: Mudlet doesnt clear screen

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

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

Re: Mudlet doesnt clear screen

Post by Vadi »

Yes - see getLastLineNumber(), getLineCount(), getLineNumber()

Post Reply