Difference between revisions of "Turtle.detectDown"
From ComputerCraft Wiki
(Corrected mapping from "Boolean" to "Boolean (type)") |
Smiley43210 (Talk | contribs) (Expanded the existing example) |
||
| Line 4: | Line 4: | ||
|args= | |args= | ||
|api=turtle | |api=turtle | ||
| − | |returns= | + | |returns={{type|boolean}} If turtle has Detected a Block Below. |
|addon=ComputerCraft | |addon=ComputerCraft | ||
|desc=Detects if there is a Block Below. | |desc=Detects if there is a Block Below. | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
| − | |desc= | + | |desc=Displays whether or not there is a block under the turtle. |
| − | |code=turtle.detectDown() | + | |code=if turtle.detectDown() then |
| + | print("There is a block under me!") | ||
| + | else | ||
| + | print("There isn't a block under me!") | ||
| + | end | ||
| + | |output=A message on the turtle screen telling if a block is under the turtle. | ||
}} | }} | ||
}} | }} | ||
[[Category:Lua_Core_Functions]] | [[Category:Lua_Core_Functions]] | ||
Revision as of 20:14, 4 May 2013
| Detects if there is a Block Below. | |
| Syntax | turtle.detectDown() |
| Returns | boolean If turtle has Detected a Block Below. |
| Part of | ComputerCraft |
| API | turtle |