printer.getCursorPos

From ComputerCraft Wiki
Revision as of 14:16, 18 July 2013 by Cranium (Talk | contribs) (Corrected API link)

Jump to: navigation, search


Grid Redstone.png  Function printer.getCursorPos
Gives you the x- and y-position of the printer cursor.
Syntax printer.getCursorPos()
Returns number x- and number y-position of the printer cursor.
Part of ComputerCraft
API printer

Examples

Grid paper.png  Example
Prints the cursor of the printer.
Code
local a, b = printer.getCursorPos()
print("X: ".. a ..", Y: ".. b)
Output X: <x position>, Y: <y position>