Difference between revisions of "Turtle.suck"

From ComputerCraft Wiki
Jump to: navigation, search
(Undo revision 4588 by 184.171.168.202 (talk))
m (Added boolean tag)
Line 3: Line 3:
 
|name=turtle.suck
 
|name=turtle.suck
 
|args=
 
|args=
|returns=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
 
|addon=ComputerCraft
 
|addon=ComputerCraft

Revision as of 20:38, 3 June 2013


Grid Redstone.png  Function turtle.suck
If an item is in the square directly in front of the turtle, it picks up one of those items.

If a chest is in the square directly in front of the turtle, it picks up the items from the first non-empty slot, moving from top left to bottom right. The items are moved into the currently selected slot, if there is room. If the currently selected slot is filled up before all of the items are picked up, the remaining items are put in the next available slot.

If the currently selected slot is 16, it will loop around and try slot 1, and so on.
Syntax turtle.suck()
Returns boolean true if at least one item was moved into the turtle's inventory; false otherwise.
Part of ComputerCraft
API turtle

Examples

Grid paper.png  Example
Picks up some items.
Code
turtle.suck()