Difference between revisions of "Turtle.drop"

From ComputerCraft Wiki
Jump to: navigation, search
(Adding "see also" for the oldly created articles and making the description clearer.)
 
(6 intermediate revisions by 4 users not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=turtle.drop
 
|name=turtle.drop
|args=count
+
|args=[<nowiki></nowiki>{{type|number}} count]
|returns=true if an item was dropped; false otherwise.
+
|returns={{type|boolean}} true if an item was dropped; false otherwise.
 
|api=turtle
 
|api=turtle
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Drops all items in the selected slot, or if [count] is specified, drops that many items.
+
|desc=Drops all items off the selected slot, or, if ''count'' is specified, drops that many items. The items are dropped on the ground by default, but if there is an inventory in that block, the items go to that inventory instead. Then the items will be placed in the first available slot of the inventory, starting at the top left, moving right and then down.
If the space in front of the turtle does not contain a chest, the items are dropped into that space.
+
If the space in front of the turtle contains a chest, the items are dropped into that chest.
+
The items will be placed in the first available slot, starting at the top left, moving right and then down.
+
 
+
turtle.dropUp and turtle.dropDown are also available, and useful for loading furnaces; dropUp when below a furnace will load the items as fuel in the furnace's bottom slot, while dropDown when above the furnace will load the top slot for smelting.
+
 
|examples=
 
|examples=
 
{{Example
 
{{Example
Line 18: Line 13:
 
}}
 
}}
 
}}
 
}}
 +
 +
==See also==
 +
*[[turtle.dropDown]]
 +
*[[turtle.dropUp]]
 +
 +
[[Category:Lua_Core_Functions]]

Latest revision as of 20:56, 21 April 2015


Grid Redstone.png  Function turtle.drop
Drops all items off the selected slot, or, if count is specified, drops that many items. The items are dropped on the ground by default, but if there is an inventory in that block, the items go to that inventory instead. Then the items will be placed in the first available slot of the inventory, starting at the top left, moving right and then down.
Syntax turtle.drop([number count])
Returns boolean true if an item was dropped; false otherwise.
Part of ComputerCraft
API turtle

Examples

Grid paper.png  Example
Drops all items in the first available slot.
Code
turtle.drop()


See also