Difference between revisions of "Turtle.detectUp"
From ComputerCraft Wiki
Smiley43210 (Talk | contribs) m (Corrected sentence casing (don't capitalize non-nouns in the middle of a sentence -_-), grammar) |
MKlegoman357 (Talk | contribs) m (Expanded) |
||
Line 4: | Line 4: | ||
|args= | |args= | ||
|api=turtle | |api=turtle | ||
− | |returns={{type|boolean}} | + | |returns={{type|boolean}} is there a block above the turtle? |
|addon=ComputerCraft | |addon=ComputerCraft | ||
|desc=Detects if there is a block above the turtle. | |desc=Detects if there is a block above the turtle. | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc= | + | |desc=If there is a block above the turtle digs it. |
− | |code=turtle.detectUp() | + | |code= if '''turtle.detectUp()''' then |
+ | [[turtle.digUp]]() | ||
+ | end | ||
}} | }} | ||
}} | }} | ||
[[Category:Lua_Core_Functions]] | [[Category:Lua_Core_Functions]] |
Revision as of 16:51, 10 April 2014
Function turtle.detectUp | |
Detects if there is a block above the turtle. | |
Syntax | turtle.detectUp() |
Returns | boolean is there a block above the turtle? |
Part of | ComputerCraft |
API | turtle |
Examples
Example | |
If there is a block above the turtle digs it. | |
Code |
if turtle.detectUp() then turtle.digUp() end |