Page 1 of 1

mini window cursor control and printing demo

Posted: Sat Jul 18, 2009 1:56 pm
by Heiko

Code: Select all

-- set up the small system message window in the top right corner 

-- determine the size of your screen
WindowWidth, WindowHeight = getMainWindowSize();

-- define a mini console named "sys" and set its background color

-- you *must* set the font size, otherwise mini windows will not work properly
setMiniConsoleFontSize("sys", 12);
-- wrap lines in window "sys" at 65 characters per line
setWindowWrap("sys", 60);
-- set default font colors and font style for window "sys"

-- clear the window

-- note: most functions can take an optional first window-name parameter (here: "sys")
-- that tells Mudlet which window you want to operate on. For the main screen this can be left out
-- e.g. setFgColor( 10,10,0) would set the fg color of the main screen
setFgColor("sys", 10,10,0)
setBgColor("sys", 0,0,255)
echo("sys", "test1---line1\n<this line is to be deleted>\n<this line is to be deleted also>\n")
echo("sys", "test1---line2\n")
echo("sys", "test1---line3\n")
echo("sys", "test1---line4\n")
echo("sys", "test1---line5\n")
moveCursor("sys", 1,1)

-- deleting lines 2+3

-- inserting a line at pos 5,2
moveCursor("sys", 5,2);
setFgColor("sys", 100,100,0)
setBgColor("sys", 255,100,0)
insertText("sys","############## line inserted at pos 2/2 ##############");

-- inserting a line at pos 0,0
moveCursor("sys", 0,0)
setFgColor("sys", 255,155,255);
setBold( "sys", true );
setUnderline( "sys", true );
setItalics( "sys", true );
insertText("sys", "------- line inserted at: 0/0 -----\n");

setBold( "sys", true )
setUnderline( "sys", false )
setItalics( "sys", false )
setFgColor("sys", 255,100,0)
setBgColor("sys", 155,155,0)
echo("sys", "*** This is the end. ***\n");

Re: mini window cursor control and printing demo

Posted: Mon Feb 16, 2015 11:59 am
by tezoost
Is there a way for Mudlet to understand if the current cmd is empty?

Re: mini window cursor control and printing demo

Posted: Mon Feb 16, 2015 9:13 pm
by Vadi
Not possible to check what is currently in the command line box at the moment