Neopherus

shaft

Apr 13th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. tArgs = { ... }
  2. togo = tonumber(tArgs[1])
  3.  
  4. function compare()
  5. for c=1,4 do
  6. turtle.select(c)
  7. if not turtle.compare(c) then
  8. turtle.dig()
  9. sleep(.2)
  10. end
  11. end
  12. end
  13. function spin()
  14. for s=1,4 do
  15. compare()
  16. sleep(.2)
  17. turtle.turnRight()
  18. end
  19. end
  20.  
  21. function home()
  22. while not turtle.detectUp() do
  23. turtle.up()
  24. end
  25. end
  26.  
  27. for i=1,togo do
  28. turtle.digDown()
  29. spin()
  30. turtle.down()
  31. end
  32.  
  33. home()
  34. turtle.back()
Advertisement
Add Comment
Please, Sign In to add comment