Advertisement
obsidian777

3tunnel

Aug 9th, 2013
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. local x = 0
  15. term.write("Tunnel length: ")
  16. x = read()
  17. run = x * 0.5
  18.  
  19. digIt()
  20. turtle.turnRight()
  21. digIt()
  22. turtle.turnLeft()
  23. turtle.turnLeft()
  24. turtle.forward()
  25. digIt()
  26. turtle.turnRight()
  27.  
  28. for i = 1, run do
  29.   digIt()
  30.   turtle.turnRight()
  31.   digIt()
  32.   digIt()
  33.   turtle.turnLeft()
  34.   digIt()
  35.   turtle.turnLeft()
  36.   digIt()
  37.   digIt()
  38. turtle.turnRight()
  39. end
  40.  
  41. turtle.turnRight()
  42. turtle.forward()
  43. turtle.turnLeft()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement