CLI Module
#cli.clear cli.clear()

Clears the console window by filling it with blanks.

#cli.resetColor cli.resetColor()

Resets the console's foreground(text) and background colors, as well as attributes, back to defaults.

#cli.getColor number cli.getColor()

Returns the console's current attribute mask (as a number).

#cli.setColor cli.setColor(number foreground) cli.setColor(number foreground, number background)

Modify the console's attribute mask. You should probably use one of the color constants listed below.

cli.BLACK cli.BLUE
cli.GREEN cli.CYAN
cli.RED cli.MAGENTA
cli.YELLOW cli.WHITE
cli.GRAY cli.LIGHT_BLUE
cli.LIGHT_GREEN cli.LIGHT_CYAN
cli.LIGHT_RED cli.LIGHT_MAGENTA
cli.LIGHT_YELLOW cli.LIGHT_WHITE

Due to the way attribute masks work, you may also modify the background color by multiplying a color by 16 and adding it to the text color.

For Example:
cli.setColor(16*cli.LIGHT_WHITE + cli.BLUE); -- This produces blue text against a light white background.

This is why getColor() only returns one value. The second parameter for setColor() has been added for your convenience.

#cli.getAttributes number winWidth, number winHeight, number buffWidth, number buffHeight, number cursorX, number cursorY cli.getAttributes()

Returns a set of console attributes. Width & height values are in characters (ie. console is 80 characters wide by default), not pixels!

#cli.setAttributes cli.setAttributes(number windowWidth, number windowHeight, number bufferWidth, number bufferHeight)

Modify the console's attributes. Width & height values should be in characters, not pixels.

Page last updated at 2018-09-25 20:47:21


Copyright 2024