psicubed

Untitled

Aug 18th, 2022
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. function digIt()
  2. while turtle.detect() do
  3. turtle.dig()
  4. os.sleep(0.5)
  5. end
  6. turtle.forward()
  7. while turtle.detectDown() or turtle.detectUp() do
  8. turtle.digUp()
  9. turtle.digDown()
  10. end
  11. end
  12.  
  13. local run = 0
  14. term.write("Tunnel length: ")
  15. run = read()
  16.  
  17. for i = 1, run do
  18. digIt()
  19. turtle.turnLeft()
  20. digIt()
  21. turtle.turnRight()
  22. turtle.turnRight()
  23. turtle.forward()
  24. digIt()
  25. turtle.back()
  26. turtle.turnLeft()
  27. end
Add Comment
Please, Sign In to add comment