Clear

From ComputerCraft Wiki
Revision as of 02:58, 25 June 2014 by Bomb Bloke (Talk | contribs) (shell.run("clear") shouldn't even be hinted at.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Clear is a built-in shell script for use within ComputerCraft. Running it wipes the current display and moves the cursor to the top left position.

The equivalent code (for use within your own scripts) would be:

term.setBackgroundColor(colours.black)  -- Set the background colour to black.
term.clear()                            -- Paint the entire display with the current background colour.
term.setCursorPos(1,1)                  -- Move the cursor to the top left position.