Advertisement
CoachFlaps

Mining Turtle strip mining (chest + refuel)

Oct 3rd, 2024 (edited)
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.75 KB | Gaming | 0 0
  1.  
  2. --Place the turtle in front of the blocks you want it to start to strip mine.
  3. --Place chests in slot 16 and give it some coal to start.
  4. --It will mine 80 blocks forward, turn to the right, leave a 2 Block gap, and mine 80 blocks back.
  5.  
  6. --When it is done mining it will dif a 2 wide Hallway, place a chest, dump all its contents and move to a new starting position.
  7. --If there is enough fuel and more chests the turtle will repeat indefinitely.
  8.  
  9.  
  10. term.clear()
  11. term.setCursorPos(1,1)
  12.  
  13. print("Turtle is now powered on.")
  14. shell.run("refuel")
  15.  
  16. FL = turtle.getFuelLevel()
  17. turtle.select(16)
  18. sloot = turtle.getItemDetail()
  19. Chest = turtle.getItemCount()
  20.  
  21.  
  22. l=0
  23.  
  24. while l < 1 do
  25.  
  26. if FL > 500 and Chest > 0 and sloot.name == "minecraft:chest" then
  27.  
  28. function dig()
  29.     turtle.digUp()
  30.     turtle.digDown()
  31.     turtle.dig()
  32.     sleep(1)
  33.     block = turtle.detect()
  34.     while turtle.detect() == true do
  35.         turtle.dig()
  36.         sleep(1)
  37.         block = turtle.detect()
  38.     end
  39.     turtle.forward()
  40.  
  41. end
  42.  
  43.  
  44. i = 0
  45. while i < 80 do
  46.     dig()
  47.     i = i + 1
  48. end
  49.  
  50. turtle.turnRight()
  51.  
  52. i = 0
  53. while i <3 do
  54.     dig()
  55.     i = i + 1
  56. end
  57.  
  58. turtle.turnRight()
  59. shell.run("refuel")
  60.  
  61. i = 0
  62. while i < 80 do
  63.     dig()
  64.     i = i + 1
  65. end
  66.  
  67. turtle.digUp()
  68. turtle.digDown()
  69. turtle.turnRight()
  70.  
  71. i = 0
  72. while i <2 do
  73.     dig()
  74.     i = i + 1
  75. end
  76.  
  77. turtle.turnLeft()
  78. turtle.dig()
  79. turtle.digUp()
  80. turtle.digDown()
  81. turtle.forward()
  82. turtle.digUp()
  83. turtle.digDown()
  84.  
  85. turtle.turnLeft()
  86.  
  87. i = 0
  88. while i <5 do
  89.     dig()
  90.     i = i + 1
  91. end
  92.  
  93. turtle.turnLeft()
  94. turtle.dig()
  95. turtle.digUp()
  96. turtle.digDown()
  97. turtle.forward()
  98. turtle.digUp()
  99. turtle.digDown()
  100. turtle.turnLeft()
  101.  
  102. i = 0
  103. while i <2 do
  104.     dig()
  105.     i = i + 1
  106. end
  107.  
  108. turtle.turnLeft()
  109. turtle.turnLeft()
  110. turtle.dig()
  111. turtle.digUp()
  112. turtle.digDown()
  113. turtle.forward()
  114. turtle.dig()
  115. turtle.forward()
  116.  
  117. turtle.turnLeft()
  118. turtle.dig()
  119. turtle.digUp()
  120. turtle.digDown()
  121. turtle.forward()
  122. turtle.turnLeft()
  123. turtle.dig()
  124. turtle.forward()
  125. turtle.digUp()
  126.  
  127. turtle.turnLeft()
  128. turtle.turnLeft()
  129. turtle.dig()
  130. turtle.forward()
  131. turtle.turnLeft()
  132. turtle.turnLeft()
  133. turtle.select(16)
  134. turtle.place()
  135. shell.run("refuel")
  136.  
  137. i = 1
  138. while i < 16 do
  139.     turtle.select(i)
  140.     turtle.drop(64)
  141.     i = i + 1
  142. end
  143.  
  144. turtle.turnLeft()
  145. turtle.dig()
  146. turtle.forward()
  147. turtle.turnLeft()
  148. turtle.turnLeft()
  149. FL = turtle.getFuelLevel()
  150. turtle.select(16)
  151. Chest = turtle.getItemCount()
  152. sloot = turtle.getItemDetail()
  153.  
  154. if sloot == nil then
  155.     l=1
  156. end
  157.  
  158.  
  159. else
  160.  
  161. l=1
  162. end
  163. end
  164.  
  165. if FL < 500 then
  166.     print("Turtle has run out of fuel, shutting down.")
  167. end
  168.  
  169. if Chest == 0 then
  170.     print(" Turtle has run out of chests, shutting down.")
  171. end
  172.  
  173. print("Programm stopped.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement