Difference between revisions of "Printer.getCursorPos"

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

Revision as of 14:16, 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 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>