Difference between revisions of "Turtle.equipRight"
From ComputerCraft Wiki
(Created page) |
Bomb Bloke (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
{{lowercase}} | {{lowercase}} | ||
+ | {{Function | ||
+ | |name=turtle.equipRight | ||
+ | |api=turtle | ||
+ | |returns=true, or false if an invalid item was in the selected inventory slot. | ||
+ | |addon=ComputerCraft | ||
+ | |desc=As of ComputerCraft 1.6, [[turtle]]s may have items added to (or even removed from!) them outside of the crafting grid. If a valid item exists in the currently selected inventory slot, this command places it on the turtle's right side. If an item was already present there, it'll be placed back into the inventory in the currently selected slot (assuming it's not taken up by eg an item that the turtle couldn't equip). Both actions can be performed in one go, allowing turtles to instantly swap tools.<br><br> | ||
+ | |||
+ | Turtles may equip [[Turtle#Recipes|most any item they could be crafted together with]].<br><br> | ||
+ | |||
+ | See also: [[Turtle.equipLeft|turtle.equipLeft()]] | ||
+ | |examples= | ||
+ | {{Example | ||
+ | |desc=Executed on a standard farming turtle (with a hoe on its left side), and assuming a diamond pick is in the currently selected inventory slot, has it equip both items - allowing it to plough dirt ''and'' collect blocks using [[Turtle.dig|turtle.dig()]]. | ||
+ | |code= turtle.equipRight() | ||
+ | }} | ||
+ | }} | ||
+ | |||
+ | [[Category:API_Functions]] |
Revision as of 02:11, 29 March 2014
Function turtle.equipRight | |
As of ComputerCraft 1.6, turtles may have items added to (or even removed from!) them outside of the crafting grid. If a valid item exists in the currently selected inventory slot, this command places it on the turtle's right side. If an item was already present there, it'll be placed back into the inventory in the currently selected slot (assuming it's not taken up by eg an item that the turtle couldn't equip). Both actions can be performed in one go, allowing turtles to instantly swap tools. Turtles may equip most any item they could be crafted together with. | |
Syntax | turtle.equipRight() |
Returns | true, or false if an invalid item was in the selected inventory slot. |
Part of | ComputerCraft |
API | turtle |
Examples
Example | |
Executed on a standard farming turtle (with a hoe on its left side), and assuming a diamond pick is in the currently selected inventory slot, has it equip both items - allowing it to plough dirt and collect blocks using turtle.dig(). | |
Code |
turtle.equipRight() |