term.getCursorPos

From ComputerCraft Wiki
Revision as of 07:51, 23 January 2013 by Cruor (Talk | contribs) (localised)

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


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

Examples

Grid paper.png  Example
Prints the location of the cursor on screen.
Code
local x, y = term.getCursorPos()
print(x .. ", " .. y)