zippy36jr

betterTunnel

Jun 24th, 2018 (edited)
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. local args = {...}
  2.  
  3. local dist = tonumber(args[1])
  4.  
  5. local movementCount = 0
  6.  
  7. function dig()
  8. turtle.digUp()
  9. turtle.digDown()
  10. turtle.dig()
  11. end
  12.  
  13. function moveForward()
  14. turtle.forward()
  15. movementCount = movementCount + 1
  16. end
  17.  
  18.  
  19. while movementCount < dist do
  20. if turtle.detect() then
  21. dig()
  22. else
  23. moveForward()
  24. end
  25. end
Add Comment
Please, Sign In to add comment