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) |
Smiley43210 (Talk | contribs) m (Edited example description) |
||
(2 intermediate revisions by 2 users not shown) | |||
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=The turtle checks if there is a block above it, and if there is, it digs it. |
− | |code=turtle.detectUp() | + | |code= if '''turtle.detectUp()''' then |
+ | [[turtle.digUp]]() | ||
+ | end | ||
}} | }} | ||
}} | }} | ||
+ | ==See also== | ||
+ | *[[turtle.detect]] | ||
+ | *[[turtle.detectDown]] | ||
[[Category:Lua_Core_Functions]] | [[Category:Lua_Core_Functions]] |
Latest revision as of 12:25, 14 August 2015
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 | |
The turtle checks if there is a block above it, and if there is, it digs it. | |
Code |
if turtle.detectUp() then turtle.digUp() end |