Advertisement
MeVeN_THROWAWAY

Untitled

Jan 25th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 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. while not turtle.forward() do
  12. i = 1
  13. while not turtle.refuel() do
  14. turtle.select(i)
  15. i = i + 1
  16. end
  17. end
  18. end
  19.  
  20. while round < max do
  21. for rot = 0, 3 do
  22. success, data = turtle.detectUp()
  23. if success then
  24. turtle.digUp()
  25. pickUp()
  26. end
  27.  
  28. success, data = turtle.detectDown()
  29. if success then
  30. turtle.digDown()
  31. pickUp()
  32. end
  33.  
  34. success, data = turtle.detect()
  35. if success then
  36. turtle.dig()
  37. pickUp()
  38. end
  39.  
  40. for i = 0, round do
  41. moveAndRefuelIfNeeded()
  42. end
  43.  
  44. turtle.turnLeft()
  45. end
  46.  
  47. print("Round", round, "done")
  48. round = round + 1
  49. end
  50.  
  51. print("Done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement