Difference between revisions of "Turtle.select"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "{{lowercase}} {{Function |name=turtle.select |args= |api=turtle |returns=boolean whether the slot number specified is greater than nine or not. |addon=ComputerCraft |desc=...")
 
m
 
(17 intermediate revisions by 10 users not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=turtle.select
 
|name=turtle.select
|args=
+
|args={{type|number}} slotNumber (1-16 in ComputerCraft 1.4+, otherwise 1-9)
 
|api=turtle
 
|api=turtle
|returns=[[boolean]] whether the slot number specified is greater than nine or not.
+
|returns=[[boolean_(type)|boolean]] whether the slot number specified is within the accepted range or not.
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 
|desc=Attempts to select the specified slot.
 
|desc=Attempts to select the specified slot.
Line 10: Line 10:
 
{{Example
 
{{Example
 
|desc=Selects the specified slot
 
|desc=Selects the specified slot
|code=print(turtle.select())
+
|code=print(turtle.select(5))
|output=true unless slot number specified is greater than nine
+
|output=true
 
}}
 
}}
 
}}
 
}}
 +
 +
==See also==
 +
*[[turtle.getSelectedSlot]]
 +
 +
[[Category:Lua_Core_Functions]]

Latest revision as of 14:52, 23 February 2017


Grid Redstone.png  Function turtle.select
Attempts to select the specified slot.
Syntax turtle.select(number slotNumber (1-16 in ComputerCraft 1.4+, otherwise 1-9))
Returns boolean whether the slot number specified is within the accepted range or not.
Part of ComputerCraft
API turtle

Examples

Grid paper.png  Example
Selects the specified slot
Code
print(turtle.select(5))
Output true


See also