Advertisement
paperclipq

Untitled

Apr 20th, 2014
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1.  
  2. --3Tunnel with Torches
  3. function digIt()
  4. while turtle.detect() do turtle.dig() os.sleep(0.5)
  5. end
  6. turtle.forward()
  7. while turtle.detectDown() or turtle.detectUp() do turtle.digUp() turtle.digDown()
  8. end
  9. end
  10.  
  11. function placeTorch()
  12. turtle.select(16)
  13. turtle.placeUp()
  14. end
  15.  
  16. local run = 0
  17. term.write("Tunnel length: ")
  18. run = read()
  19.  
  20. for i = 1, run do
  21. k = i - 1
  22. j = k % 4
  23. digIt()
  24. turtle.turnLeft()
  25. digIt()
  26. turtle.turnRight()
  27. turtle.turnRight()
  28. turtle.forward()
  29. digIt()
  30. turtle.back()
  31. turtle.turnLeft()
  32. if i == 2 or j == 1 then turtle.back() turtle.turnRight() turtle.forward() placeTorch() turtle.back() turtle.back() placeTorch() turtle.forward() turtle.turnLeft() turtle.forward()
  33. end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement