Difference between revisions of "Term.getCursorPos"

From ComputerCraft Wiki
Jump to: navigation, search
(Fixed broken example and removed "none" from args)
(localised)
 
Line 10: Line 10:
 
{{Example
 
{{Example
 
|desc=Prints the location of the cursor on screen.
 
|desc=Prints the location of the cursor on screen.
|code=x, y = term.getCursorPos()<br />print(x .. ", " .. y)
+
|code=local x, y = term.getCursorPos()<br />print(x .. ", " .. y)
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Latest revision as of 07:51, 23 January 2013


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)