turtle.detect

From ComputerCraft Wiki
Revision as of 16:57, 6 October 2012 by Dadmob18 (Talk | contribs)

Jump to: navigation, search


Grid Redstone.png  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

Grid paper.png  Example
Detects if there is a Block in front and digs it out.
Code
if turtle.detect() then 
turtle.dig()
end