Difference between revisions of "Printer.getCursorPos"

From ComputerCraft Wiki
Jump to: navigation, search
(Corrected API link)
m
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=printer.getCursorPos
 
|name=printer.getCursorPos
|returns={{type|number}} x- and {{type|number}} y-position of the printer cursor.
+
|returns={{type|number}} x- and y-position of the printer cursor.
 
|api=printer
 
|api=printer
 
|addon=ComputerCraft
 
|addon=ComputerCraft

Revision as of 14:19, 18 July 2013


Grid Redstone.png  Function printer.getCursorPos
Gives you the x- and y-position of the printer cursor.
Syntax printer.getCursorPos()
Returns number x- and 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>