Advertisement
marnixah

Untitled

Jun 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement