Difference between revisions of "Turtle.detectUp"
From ComputerCraft Wiki
(Created page with "{{lowercase}} {{Function |name=turtle.detectUp |args= |api=turtle |returns=boolean If turtle has Detected a Block Above. |addon=ComputerCraft |desc=Detects if there is a B...") |
Smiley43210 (Talk | contribs) m (Edited example description) |
||
| (8 intermediate revisions by 7 users not shown) | |||
| Line 4: | Line 4: | ||
|args= | |args= | ||
|api=turtle | |api=turtle | ||
| − | |returns= | + | |returns={{type|boolean}} is there a block above the turtle? |
|addon=ComputerCraft | |addon=ComputerCraft | ||
| − | |desc=Detects if there is a | + | |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= | + | |code= if '''turtle.detectUp()''' then |
| + | [[turtle.digUp]]() | ||
| + | end | ||
}} | }} | ||
}} | }} | ||
| + | ==See also== | ||
| + | *[[turtle.detect]] | ||
| + | *[[turtle.detectDown]] | ||
| + | |||
| + | [[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 |