Xmann1

Untitled

Aug 10th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. function refuel()
  2. if turtle.getFuelLevel() < 15 then
  3. turtle.select(1)
  4. turtle.refuel(1)
  5. end
  6. end
  7.  
  8. function interactTree()
  9. a, b = turtle.inspect()
  10. if a then
  11. if b.name == "minecraft:sapling" then
  12. elseif b.name == "minecraft:log" then
  13. mineTree()
  14. else
  15. print("WARNING: Unknown block found: ", b.name)
  16. turtle.dig()
  17. plantSaplings()
  18. end
  19. else
  20. --plantSaplings()
  21. end
  22. end
  23.  
  24. function plantSaplings()
  25.  
  26. end
  27.  
  28. function mineTree()
  29.  
  30. end
  31.  
  32. function startup()
  33. refuel()
  34. turtle.forward()
  35. turtle.forward()
  36. turtle.forward()
  37. end
  38.  
  39. function harvest()
  40. -- Go forward one lane
  41. for i=1, 7 do
  42. refuel()
  43. turtle.turnLeft()
  44. interactTree()
  45. turtle.turnRight()
  46. turtle.turnRight()
  47. interactTree()
  48. turtle.turnLeft()
  49. turtle.forward()
  50. turtle.forward()
  51. turtle.forward()
  52. end
  53.  
  54. -- Switch to right next lane
  55.  
  56. turtle.turnRight()
  57. for i=1, 6 do
  58. refuel()
  59. turtle.forward()
  60. end
  61. turtle.turnRight()
  62.  
  63. turtle.forward()
  64. turtle.forward()
  65.  
  66. -- Go forward one lane
  67.  
  68. for i=1, 7 do
  69. refuel()
  70. turtle.turnLeft()
  71. interactTree()
  72. turtle.turnRight()
  73. turtle.turnRight()
  74. interactTree()
  75. turtle.turnLeft()
  76. turtle.forward()
  77. turtle.forward()
  78. turtle.forward()
  79. end
  80.  
  81. -- Switch to right next lane
  82.  
  83. turtle.turnLeft()
  84. for i=1, 6 do
  85. refuel()
  86. turtle.forward()
  87. end
  88. turtle.turnLeft()
  89.  
  90. turtle.forward()
  91. turtle.forward()
  92. end
  93.  
  94. startup()
  95. harvest()
Advertisement
Add Comment
Please, Sign In to add comment