SmashBro

Strip Mine

Apr 27th, 2020
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. local length = 0
  2.  
  3. print("How long do you want the tunnel?")
  4. length = io.read()
  5. length = tonumber(length)
  6.  
  7. for i=0, length do
  8. if (turtle.detect() and i < length) then
  9. turtle.dig()
  10. end
  11. if turtle.detectUp() then
  12. turtle.digUp()
  13. end
  14. if turtle.detectDown() then
  15. turtle.digDown()
  16. end
  17. if (i%10==0) then
  18. turtle.select(2)
  19. turtle.placeDown()
  20. turtle.select(1)
  21. end
  22. if (turtle.detect() == false) then
  23. turtle.forward()
  24. end
  25. if (turtle.getFuelLevel() <= 1) then
  26. turtle.refuel(1)
  27. end
  28. end
  29.  
  30. turtle.turnLeft()
  31. turtle.turnLeft()
  32.  
  33. for i=0, length-1 do
  34. if turtle.detect() then
  35. turtle.dig()
  36. end
  37. turtle.forward()
  38. sleep(1)
  39. end
Add Comment
Please, Sign In to add comment