Difference between revisions of "Turtle.detectUp"
From ComputerCraft Wiki
MKlegoman357 (Talk | contribs) m (Expanded) |
Smiley43210 (Talk | contribs) m (Edited example description) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 9: | Line 9: | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
| − | |desc= | + | |desc=The turtle checks if there is a block above it, and if there is, it digs it. |
|code= if '''turtle.detectUp()''' then | |code= if '''turtle.detectUp()''' then | ||
[[turtle.digUp]]() | [[turtle.digUp]]() | ||
| Line 15: | Line 15: | ||
}} | }} | ||
}} | }} | ||
| + | ==See also== | ||
| + | *[[turtle.detect]] | ||
| + | *[[turtle.detectDown]] | ||
[[Category:Lua_Core_Functions]] | [[Category:Lua_Core_Functions]] | ||
Latest revision as of 12:25, 14 August 2015
| 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
| 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 |