Difference between revisions of "Turtle.suck"
From ComputerCraft Wiki
(Minecraft 1.5 changed how furnaces work, so some clarification on changes) |
Bomb Bloke (Talk | contribs) (As of CC 1.6, can now specify an amount to suck.) |
||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=turtle.suck | |name=turtle.suck | ||
− | |args= | + | |args=[<nowiki></nowiki>{{type|number}} amount] |
|returns=[[boolean_(type)|boolean]] true if at least one item was moved into the turtle's inventory; false otherwise. | |returns=[[boolean_(type)|boolean]] true if at least one item was moved into the turtle's inventory; false otherwise. | ||
|api=turtle | |api=turtle | ||
Line 12: | Line 12: | ||
* If the currently selected turtle slot is filled up before all of the items are picked up, the remaining picked up items are put in the next available turtle slot. | * If the currently selected turtle slot is filled up before all of the items are picked up, the remaining picked up items are put in the next available turtle slot. | ||
* If the currently selected turtle slot is 16 and the next slot is required, it will loop around and try turtle slot 1, and so on. | * If the currently selected turtle slot is 16 and the next slot is required, it will loop around and try turtle slot 1, and so on. | ||
− | * As of Minecraft 1.5/ComputerCraft 1.51, turtle.suckUp can be used to pick items out of the output slot of a furnace. | + | * As of Minecraft 1.5/ComputerCraft 1.51, turtle.suckUp can be used to pick items out of the output slot of a furnace. |
+ | * As of ComputerCraft 1.6, if an amount is specified, the turtle will attempt to pick up at most the specified number of items. Earlier builds always attempt to pick up a full slot. | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc=Picks up some items. | + | |desc=Picks up some items from in front of the turtle. |
|code=turtle.suck() | |code=turtle.suck() | ||
+ | }} | ||
+ | {{Example | ||
+ | |desc=Picks up some items from above the turtle. | ||
+ | |code=turtle.suckUp() | ||
+ | }} | ||
+ | {{Example | ||
+ | |desc=Picks up some items from below the turtle. | ||
+ | |code=turtle.suckDown() | ||
}} | }} | ||
}} | }} | ||
[[Category:Lua_Core_Functions]] | [[Category:Lua_Core_Functions]] |
Revision as of 02:19, 16 August 2014
Function turtle.suck | |
Moves one or more items from either the ground in front of the turtle, or, from an inventory-enabled block (such as a chest) in front of the turtle.
| |
Syntax | turtle.suck([number amount]) |
Returns | boolean true if at least one item was moved into the turtle's inventory; false otherwise. |
Part of | ComputerCraft |
API | turtle |
Examples
Example | |
Picks up some items from in front of the turtle. | |
Code |
turtle.suck() |
Example | |
Picks up some items from above the turtle. | |
Code |
turtle.suckUp() |
Example | |
Picks up some items from below the turtle. | |
Code |
turtle.suckDown() |