turtle.detectUp

From ComputerCraft
Jump to: navigation, search

turtle.detectUp
Function
Syntax
turtle.detectUp()
Returns boolean result
API turtle
Source CC:Tweaked (source)

When called, will return true if the block above the turtle is anything that is not air or liquid.

ExampleExampleDetecting blocks
Detect if there is a block above the turtle.
Code
local result = turtle.detectUp()
if result then
  print("There is a block above the turtle!")
else
  print("There is no block above the turtle, only air or a liquid.")
end
Output
There is a block above the turtle!