Advertisement
jordyvl

Turtle detection

May 9th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.28 KB | None | 0 0
  1. local function forward()
  2.   if(turtle.forward() == false) then
  3.     if(turtle.detect()) then
  4.       turtle.dig()
  5.       forward()
  6.     elseif(turtle.detect() == false) then
  7.       print("OMFG")
  8.       turtle.attack()
  9.       forward()
  10.     end
  11.   else
  12.     turtle.forward()
  13.   end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement