Advertisement
Drakaxx

Minage Horizontal

Apr 17th, 2019 (edited)
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  1. profondeur = 6
  2. largeur = 3
  3. hauteur = 2
  4.  
  5. function wThrow()
  6. for s=1,15 do
  7. turtle.select(s)
  8. toThrow = turtle.getItemDetail()
  9. if toThrow then
  10. if toThrow.name == 'minecraft:cobblestone' then
  11. turtle.drop()
  12. end
  13. if toThrow.name == 'minecraft:dirt' then
  14. turtle.drop()
  15. end
  16. if toThrow.name == 'minecraft:stone' then
  17. turtle.drop()
  18. end
  19. if toThrow.name == 'minecraft:gravel' then
  20. turtle.drop()
  21. end
  22. if toThrow.name == 'chisel:limestone2' then
  23. turtle.drop()
  24. end
  25. if toThrow.name == 'chisel:marble2' then
  26. turtle.drop()
  27. end
  28. if toThrow.name == 'minecraft:sand' then
  29. turtle.drop()
  30. end
  31. if toThrow.name == 'chisel:basalt2' then
  32. turtle.drop()
  33. end
  34. end
  35. end
  36. wSort()
  37. end
  38.  
  39. function Fuel()
  40. if turtle.getFuelLevel() <= 3 then
  41. turtle.select(16)
  42. turtle.refuel(1)
  43. end
  44. end
  45.  
  46. function wDetectDig()
  47. turtle.select(1)
  48. local j = 1
  49. while j <= 10 do
  50. if turtle.detectUp() then
  51. local success, data = turtle.inspectUp()
  52. if success then
  53. if data.name ~= 'minecraft:chest' then
  54. turtle.digUp()
  55. end
  56. end
  57. end
  58. if turtle.detectDown() then
  59. turtle.digDown()
  60. end
  61. if turtle.detect() then
  62. turtle.dig()
  63. j = j + 1
  64. else
  65. j = 11
  66. end
  67. Fuel()
  68. end
  69. end
  70.  
  71. function wDig()
  72. turtle.select(1)
  73. local i = 1
  74. while i <= profondeur do
  75. wDetectDig()
  76. turtle.forward()
  77. i = i + 1
  78. end
  79. Fuel()
  80. end
  81.  
  82. function wTurnLeft()
  83. turtle.turnLeft()
  84. wDetectDig()
  85. turtle.forward()
  86. turtle.turnLeft()
  87. wThrow()
  88. end
  89.  
  90. function wTurnRight()
  91. turtle.turnRight()
  92. wDetectDig()
  93. turtle.forward()
  94. turtle.turnRight()
  95. wThrow()
  96. end
  97.  
  98. function wForward()
  99. turtle.forward()
  100. l = l + 1
  101. end
  102.  
  103. function wGoBack()
  104. turtle.turnRight()
  105. while l >= 1 do
  106. turtle.forward()
  107. l = l - 1
  108. end
  109. turtle.turnLeft()
  110. t = q
  111. while q > 0 do
  112. turtle.up()
  113. q = q - 1
  114. end
  115. q = t
  116. wDropUp()
  117.  
  118. for v=1,p do
  119. wTurnDown()
  120. end
  121. end
  122.  
  123. function wDropUp()
  124. wThrow()
  125. local success, data = turtle.inspectUp()
  126. if success then
  127. if data.name == 'minecraft:chest' then
  128. for m=1,15 do
  129. turtle.select(m)
  130. turtle.dropUp()
  131. end
  132. end
  133. end
  134. end
  135.  
  136. function wTurnDown()
  137. for n=1,3 do
  138. turtle.digDown()
  139. turtle.down()
  140. end
  141. wThrow()
  142. end
  143.  
  144. function wTurnUp()
  145. while q > 0 do
  146. turtle.up()
  147. q = q - 1
  148. end
  149. end
  150.  
  151. function wProcessHorizontal()
  152. l = 0
  153. local k = 1
  154. while k <= largeur do
  155. wDig()
  156. wTurnLeft()
  157. wDig()
  158. wTurnRight()
  159. l = l + 2
  160. k = k + 1
  161. end
  162. end
  163.  
  164. function wSort()
  165. for n=1,15 do
  166. local elItem = turtle.getItemCount(n)
  167. local elSpace = turtle.getItemSpace(n)
  168. local elData = turtle.getItemDetail(n)
  169. if elData then
  170. if elSpace > 0 then
  171. for m=1,15 do
  172. if n ~= m then
  173. local elData2 = turtle.getItemDetail(m)
  174. if elData2 then
  175. if elData.name == elData2.name then
  176. local elItem2 = turtle.getItemCount(m)
  177. local elSpace2 = turtle.getItemSpace(m)
  178. if elSpace2 > 0 then
  179. turtle.select(m)
  180. turtle.transferTo(n)
  181. end
  182. end
  183. end
  184. end
  185. end
  186. end
  187. end
  188. end
  189. end
  190.  
  191. p = 0
  192. q = 3
  193.  
  194. while p <= hauteur do
  195. turtle.select(1)
  196. wProcessHorizontal()
  197. wGoBack()
  198. wTurnDown()
  199. q = q + 3
  200. p = p + 1
  201. end
  202.  
  203. wTurnUp()
  204. wThrow()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement