Advertisement
Guest User

Untitled

a guest
Mar 15th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. local tUp = false
  2. local tDown = false
  3. local tFront = false
  4.  
  5.  
  6. while true do
  7. tUp = false
  8. tDown = false
  9. tFront = false
  10.  
  11. if turtle.detectUp(Sand) then
  12. while turtle.detectUp(Sand) do
  13. turtle.digUp()
  14. tUp = true;
  15. end
  16. elseif turtle.detectDown(Sand) then
  17. while turtle.detectDown(Sand) do
  18. turtle.digDown()
  19. tDown = true;
  20. end
  21. elseif turtle.detect(Sand) then
  22. while turtle.detect(Sand) do
  23. turtle.dig()
  24. tFront = true;
  25. end
  26. end
  27.  
  28. if tUp == true then
  29. turtle.up()
  30. elseif tDown == true then
  31. turle.down()
  32. elseif tFront == true then
  33. turtle.forward()
  34. else
  35. turtle.turnLeft()
  36. end
  37.  
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement