Difference between revisions of "Turtle.detect"
From ComputerCraft Wiki
(Adding "see also".) |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
|args= | |args= | ||
|api=turtle | |api=turtle | ||
− | |returns=[[boolean]] If turtle has Detected a Block in front. | + | |returns=[[boolean_(type)|boolean]] If turtle has Detected a Block in front. |
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc=Detects if there is a Block in front. | + | |desc=Detects if there is a Block in front. Does not detect mobs or liquids or floating items. |
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc=Detects if there is a Block in front. | + | |desc=Detects if there is a Block in front and digs it out. |
− | |code=turtle.detect() | + | |code= if turtle.detect() then <br> turtle.dig() <br>end |
}} | }} | ||
}} | }} | ||
+ | |||
+ | ==See also== | ||
+ | *[[turtle.detectUp]] | ||
+ | *[[turtle.detectDown]] | ||
+ | |||
+ | [[Category:Lua_Core_Functions]] |
Latest revision as of 17:59, 22 April 2015
Function turtle.detect | |
Detects if there is a Block in front. Does not detect mobs or liquids or floating items. | |
Syntax | turtle.detect() |
Returns | boolean If turtle has Detected a Block in front. |
Part of | ComputerCraft |
API | turtle |
Examples
Example | |
Detects if there is a Block in front and digs it out. | |
Code |
if turtle.detect() then |