term.setCursorPos

From ComputerCraft Wiki
Jump to: navigation, search


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

Examples

Note that the x and y coordinates cannot be placed between lines. Floating point values (such as 1.5) will be rounded down to integers (like 1, in this case).

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)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox