Advertisement
Spatzenhirn123

Mining tunnel

May 12th, 2016
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local args = {...}
  2. length = args[1]
  3.    
  4. function dig()
  5.         while turtle.detect() do
  6.             turtle.dig()
  7.             os.sleep(0.5)
  8.         end
  9. end
  10. function digUp()
  11.         while turtle.detectUp() do
  12.             turtle.digUp()
  13.             os.sleep(0.5)
  14.         end
  15. end
  16. function forward()
  17.     while turtle.forward()==false do
  18.         os.sleep(1)
  19.         dig()
  20.     end
  21. end
  22.  
  23. function row()
  24.     digUp()
  25.     turtle.digDown()
  26.     for m=1,4,1 do
  27.         dig()
  28.         forward()
  29.         digUp()
  30.         turtle.digDown()
  31.     end
  32. end
  33.  
  34. ----------------------------
  35. for i=1,length,1 do
  36.     dig()
  37.     forward()
  38.     turtle.turnRight()
  39.     row()
  40.     turtle.down()
  41.     turtle.digDown()
  42.     turtle.turnRight()
  43.     turtle.turnRight()
  44.     for u=1,4,1 do
  45.         forward()
  46.         turtle.digDown()
  47.     end
  48.     turtle.up()
  49.     turtle.turnRight()
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement