SHARE
TWEET

Untitled

marnixah Jun 19th, 2019 (edited) 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local left = true
  2. local done = false
  3. function mine()
  4.     turtle.forward()
  5.     turtle.digDown()
  6. end
  7.  
  8. function detect()
  9.     done = not done
  10.     if done then
  11.         return true
  12.     end
  13.     if turtle.detect() then
  14.         left = not left
  15.         turtle.down()
  16.     end
  17. end
  18.  
  19. while true do
  20.     if turtle.detect() then
  21.         if left then
  22.             left = not left
  23.             turtle.turnLeft()
  24.             mine()
  25.             detect()
  26.             turtle.turnLeft()
  27.             turtle.digDown()
  28.         else
  29.             left = not left
  30.             turtle.turnRight()
  31.             mine()
  32.             detect()
  33.             turtle.turnRight()
  34.             turtle.digDown()
  35.         end
  36.     end
  37.     mine()
  38. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top