Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. round = 1
  2. max = 5
  3.  
  4. function pickUp()
  5. for i = 0, 5 do turtle.suck(64) end
  6. for i = 0, 5 do turtle.suckUp(64) end
  7. for i = 0, 5 do turtle.suckDown(64) end
  8. end
  9.  
  10. function moveAndRefuelIfNeeded()
  11. i = 0
  12. while not turtle.refuel() do
  13. turtle.select(i)
  14. i = i + 1
  15. end
  16. end
  17.  
  18. while round < max do
  19. for rot = 0, 3 do
  20. success, data = turtle.detectUp()
  21. if success then
  22. turtle.digUp()
  23. pickUp()
  24. end
  25.  
  26. success, data = turtle.detectDown()
  27. if success then
  28. turtle.digDown()
  29. pickUp()
  30. end
  31.  
  32. success, data = turtle.detect()
  33. if success then
  34. turtle.dig()
  35. pickUp()
  36. end
  37.  
  38. for i = 0, round do
  39. moveAndRefuelIfNeeded()
  40. end
  41.  
  42. turtle.turnLeft()
  43. end
  44.  
  45. print("Round", round, "done")
  46. round = round + 1
  47. end
  48.  
  49. print("Done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement