Advertisement
MeVeN_THROWAWAY

Untitled

Jan 25th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. max = 10
  2. round = 1
  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. success = turtle.forward()
  12. if not success then
  13. i = 1
  14. while not turtle.refuel() and i < 17 do
  15. turtle.select(i)
  16. i = i + 1
  17. end
  18. end
  19. end
  20.  
  21. function digAndMove()
  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. moveAndRefuelIfNeeded()
  41. end
  42.  
  43. while round < max do
  44.  
  45. for i = 0, max do
  46. digAndMove()
  47. end
  48.  
  49. turtle.turnLeft()
  50. digAndMove()
  51. turtle.turnLeft()
  52.  
  53. for i = 0, max do
  54. digAndMove()
  55. end
  56.  
  57. turtle.turnRight()
  58. digAndMove()
  59. turtle.turnRight()
  60.  
  61. print("Round", round, "done")
  62. round = round + 1
  63. end
  64.  
  65. print("Done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement