SummitSummit

treeTapper

Apr 12th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. local count = 0
  2. local move = 0
  3. function tap()
  4. while turtle.detect() do
  5. turtle.dig()
  6. count = count + 1
  7. turtle.up()
  8. move = move + 1
  9. end
  10. turtle.turnRight()
  11. turtle.forward()
  12. turtle.turnLeft()
  13. while move > 0 do
  14. turtle.down()
  15. count = count + 1
  16. turtle.dig()
  17. move = move - 1
  18. end
  19. end
  20.  
  21. function corner()
  22. turtle.turnRight()
  23. turtle.forward()
  24. turtle.turnLeft()
  25. turtle.forward()
  26. turtle.forward()
  27. turtle.turnLeft()
  28. end
  29.  
  30. function cycle()
  31. for i = 1, 4 do
  32. tap()
  33. corner()
  34. end
  35. end
  36.  
  37. print("Tapping...")
  38.  
  39. cycle()
  40.  
  41. print("Job's Done! Tapped "..count.." resin spots")
Advertisement
Add Comment
Please, Sign In to add comment