turtle.detectDown

From ComputerCraft Wiki
Revision as of 20:15, 4 May 2013 by Smiley43210 (Talk | contribs) (Corrected sentence casing (don't capitalize non-nouns in the middle of a sentence -_-))

Jump to: navigation, search


Grid Redstone.png  Function turtle.detectDown
Detects if there is a Block Below.
Syntax turtle.detectDown()
Returns boolean If turtle has detected a block below.
Part of ComputerCraft
API turtle

Examples

Grid paper.png  Example
Displays whether or not there is a block under the turtle.
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.