Advertisement
herobrinethree

minerxyzplus

Feb 13th, 2021 (edited)
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. refill = function()
  2. turtle.select(1)
  3. if turtle.getFuelLevel() < 50 then
  4. repeat
  5. sleep(3)
  6. turtle.digUp()
  7. turtle.placeUp()
  8. turtle.suckUp()
  9. turtle.refuel(64)
  10. turtle.dropUp()
  11. turtle.digUp()
  12. until turtle.getFuelLevel() > 50
  13. end
  14. end
  15. lastempty = function()
  16. turtle.digUp()
  17. turtle.select(2)
  18. turtle.placeUp()
  19. for i = 3, 16, 1
  20. do
  21. turtle.select(i)
  22. turtle.dropUp(64)
  23. end
  24. turtle.select(2)
  25. turtle.digUp()
  26. turtle.select(1)
  27. end
  28. empty = function()
  29. if turtle.getItemCount(15) >= 1 then
  30. turtle.digUp()
  31. turtle.select(2)
  32. turtle.placeUp()
  33. for i = 3, 16, 1
  34. do
  35. turtle.select(i)
  36. turtle.dropUp(64)
  37. end
  38. turtle.select(2)
  39. turtle.digUp()
  40. turtle.select(1)
  41. end
  42. end
  43.  
  44. destroy = function()
  45. empty()
  46. turtle.digDown()
  47. turtle.digUp()
  48. while turtle.detect() == true do
  49. turtle.dig()
  50. end
  51. end
  52. lastdestroy = function()
  53. empty()
  54. turtle.digUp()
  55. turtle.digDown()
  56. end
  57. row = function(distance)
  58. for i = 0, distance, 1
  59. do
  60. destroy()
  61. refill()
  62. turtle.forward()
  63. end
  64. end
  65. righthook = function()
  66. empty()
  67. turtle.turnRight()
  68. destroy()
  69. refill()
  70. turtle.forward()
  71. turtle.turnRight()
  72. end
  73. lefthook = function()
  74. empty()
  75. turtle.turnLeft()
  76. destroy()
  77. refill()
  78. turtle.forward()
  79. turtle.turnLeft()
  80. end
  81. square = function(Length, Depth)
  82. empty()
  83. if Length % 2 == 0 then
  84. for i = 1, Length, 2
  85. do
  86. row(Depth)
  87. righthook()
  88. row(Depth)
  89. lefthook()
  90. end
  91. row(Depth)
  92. righthook()
  93. row(Depth)
  94. lastdestroy()
  95. turtle.turnRight()
  96. for i = 0, Length, 1
  97. do
  98. refill()
  99. turtle.forward()
  100. end
  101. turtle.turnRight()
  102. elseif Length % 2 ~= 0 then
  103. for i = 0, Length, 2
  104. do
  105. row(Depth)
  106. righthook()
  107. row(Depth)
  108. lefthook()
  109. end
  110. row(Depth)
  111. lastdestroy()
  112. turtle.turnLeft()
  113. turtle.turnLeft()
  114. for i = 0, Depth, 1
  115. do
  116. refill()
  117. turtle.forward()
  118. end
  119. turtle.turnRight()
  120. for i = 0, Length, 1
  121. do
  122. refill()
  123. turtle.forward()
  124. end
  125. turtle.turnRight()
  126. elseif Length == 0 then
  127. row(Depth)
  128. turtle.turnLeft()
  129. turtle.turnLeft()
  130. for i = 0, Depth, 1
  131. do
  132. refill()
  133. turtle.forward()
  134. end
  135. turtle.turnRight()
  136. turtle.turnRight()
  137. elseif Depth == 0 then
  138. turtle.turnRight()
  139. row(Length)
  140. turtle.turnLeft()
  141. turtle.turnLeft()
  142. for i = 0, Length, 1
  143. do
  144. refill()
  145. turtle.forward()
  146. end
  147. turtle.turnRight()
  148. end
  149. lastempty()
  150. end
  151.  
  152. cube = function(Length, Depth, Height)
  153. if Height == 1 then
  154. square(Length, Depth)
  155. elseif Height > 1 then
  156. for i = 2, Height, 1
  157. do
  158. square(Length, Depth)
  159. for i = 1, 3, 1
  160. do
  161. empty()
  162. turtle.digDown()
  163. refill()
  164. turtle.down()
  165. end
  166. end
  167. square(Length, Depth)
  168. for i = 4, Height * 3, 1
  169. do
  170. refill()
  171. turtle.up()
  172. end
  173. elseif Length == 1 and Depth == 1 then
  174. lastdestroy()
  175. for i = 1, Height * 3, 1
  176. do
  177. empty()
  178. turtle.digDown()
  179. refill()
  180. turtle.down()
  181. end
  182. lastdestroy()
  183. for i = 1, Height * 3, 1
  184. do
  185. refill()
  186. turtle.up()
  187. end
  188. end
  189. end
  190.  
  191.  
  192.  
  193. term.write("Select Depth: ")
  194. local depth = read()
  195. depth = depth - 2
  196. term.write("Select Length: ")
  197. local length = read()
  198. length = length - 2
  199. term.write("Select Height: ")
  200. local height = read()
  201. height = height + 0
  202. refill()
  203. cube(length, depth, height)
  204. print("Mining Completed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement