Difference between revisions of "Turtle.digUp"
From ComputerCraft Wiki
(Undo revision 3599 by 91.121.27.33 (talk)) |
(Add toolSide argument) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=turtle.digUp | |name=turtle.digUp | ||
− | |||
|api=turtle | |api=turtle | ||
− | |returns= | + | |args=[<nowiki/>{{type|string}} toolSide] |
+ | |returns={{Type|boolean}} whether the turtle succeeded in digging, {{type|string}} error message | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc=Attempts to dig the block above of the turtle. | + | |desc=Attempts to dig the block above of the turtle. If successful, [[Turtle.suck|suck()]] is automatically called, placing the item in turtle inventory in the selected slot if possible (block type matches and the slot is not a full stack yet), or in the next available slot. |
|examples= | |examples= | ||
{{Example | {{Example | ||
|desc=Digs the block above the turtle. | |desc=Digs the block above the turtle. | ||
− | |code=print(turtle.digUp()) | + | |code=print('''turtle.digUp()''') |
|output=true if the turtle could dig the block, false if it could not or no block present. | |output=true if the turtle could dig the block, false if it could not or no block present. | ||
}} | }} | ||
}} | }} | ||
+ | |||
+ | ==See also== | ||
+ | *[[turtle.dig]] | ||
+ | *[[turtle.digDown]] | ||
+ | |||
+ | [[Category:Lua_Core_Functions]] |
Latest revision as of 10:35, 24 October 2018
Function turtle.digUp | |
Attempts to dig the block above of the turtle. If successful, suck() is automatically called, placing the item in turtle inventory in the selected slot if possible (block type matches and the slot is not a full stack yet), or in the next available slot. | |
Syntax | turtle.digUp([string toolSide]) |
Returns | boolean whether the turtle succeeded in digging, string error message |
Part of | ComputerCraft |
API | turtle |
Examples
Example | |
Digs the block above the turtle. | |
Code |
print(turtle.digUp()) |
Output | true if the turtle could dig the block, false if it could not or no block present. |