Advertisement
CoachFlaps

Mining Turtle strip mining (chest + no refuel))

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