term.setCursorPos

From ComputerCraft Wiki
Revision as of 18:41, 28 November 2012 by AfterLifeLochie (Talk | contribs) (Moved to CAT:APIFunctions)

Jump to: navigation, search


Grid Redstone.png  Function term.setCursorPos
Sets the location of the cursor on screen.
Syntax term.setCursorPos(int x, int y)
Returns none
Part of ComputerCraft
API term

Examples

Basic usage

Grid paper.png  Example
Sets the location of the cursor on screen to the top
Code
term.setCursorPos(1,1)



Using the old cursor position to affect the new one

Grid paper.png  Example
Sets the location of the cursor to the start of the line.
Code
oldx, oldy = term.getCursorPos()
term.setCursorPos(1,oldy)