funkd0ct0r

Untitled

Jun 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. --coal in slot2, cobble in 1
  2. --bpHAGRet
  3.  
  4. width = 14-1
  5.  
  6. junk_blocks = "minecraft:cobblestone minecraft:dirt minecraft:gravel chisel:limestone chisel:marble"
  7.  
  8. function digWall(func)
  9. local inspect = turtle.inspect
  10. if func == turtle.digUp then
  11. inspect = turtle.inspectUp
  12. end
  13. if func == turtle.digDown then
  14. inspect = turtle.inspectDown
  15. end
  16. local s,d = inspect()
  17. if s and d and d.name == "minecraft:stone" then
  18. return 1
  19. end
  20. return func()
  21. end
  22.  
  23. function buildWall(func)
  24. if turtle.getItemCount(1) > 1 then
  25. return func()
  26. end
  27. return true
  28. end
  29.  
  30. function clearLava(func)
  31. if turtle.getItemCount(1) > 1 then
  32. return func()
  33. end
  34. return true
  35. end
  36.  
  37. turtle.turnLeft()
  38. while true do
  39.  
  40. --refueling
  41. turtle.select(2)
  42. while turtle.getFuelLevel() < 256 do
  43. if turtle.getItemCount(2) > 1 then
  44. turtle.refuel(1)
  45. end
  46. sleep(0.5)
  47. end
  48. turtle.select(1)
  49.  
  50. --clear inventory
  51. local lastSlot = 3
  52. local slot = 3
  53. for slot = 16, 3, -1 do
  54. if turtle.getItemCount(slot) > 0 then
  55. lastSlot = slot
  56. break
  57. end
  58. end
  59. while slot < lastSlot do
  60. turtle.select(slot)
  61. data = turtle.getItemDetail(slot)
  62. if turtle.compareTo(1) or (data and junk_blocks:find(data.name)) then
  63. turtle.drop()
  64. turtle.select(lastSlot)
  65. turtle.transferTo(slot)
  66. lastSlot = lastSlot - 1
  67. slot = slot - 1
  68. end
  69. slot = slot + 1
  70. end
  71. while turtle.getItemCount(16) > 0 do
  72. sleep(1)
  73. end
  74. turtle.select(1)
  75.  
  76. --tunnel bore
  77. --first row
  78. for x = 1, width do
  79. digWall(turtle.digDown)
  80. buildWall(turtle.placeDown)
  81. clearLava(turtle.placeUp)
  82. turtle.digUp()
  83. repeat turtle.dig() until turtle.forward()
  84. end
  85.  
  86. digWall(turtle.digDown)
  87. buildWall(turtle.placeDown)
  88. clearLava(turtle.placeUp)
  89. turtle.digUp()
  90.  
  91. digWall(turtle.dig)
  92. buildWall(turtle.place)
  93. repeat turtle.digUp() until turtle.up()
  94. digWall(turtle.dig)
  95. buildWall(turtle.place)
  96. repeat turtle.digUp() until turtle.up()
  97. digWall(turtle.dig)
  98. buildWall(turtle.place)
  99. repeat turtle.digUp() until turtle.up()
  100. digWall(turtle.dig)
  101. buildWall(turtle.place)
  102.  
  103. turtle.turnRight()
  104. turtle.turnRight()
  105.  
  106.  
  107. --second row
  108. for x = 1, width do
  109. clearLava(turtle.placeDown)
  110. turtle.digDown()
  111. clearLava(turtle.placeUp)
  112. turtle.digUp()
  113. repeat turtle.dig() until turtle.forward()
  114. end
  115.  
  116. clearLava(turtle.placeDown)
  117. turtle.digDown()
  118.  
  119.  
  120. digWall(turtle.dig)
  121. buildWall(turtle.place)
  122. repeat turtle.digUp() until turtle.up()
  123. digWall(turtle.dig)
  124. buildWall(turtle.place)
  125. repeat turtle.digUp() until turtle.up()
  126. digWall(turtle.dig)
  127. buildWall(turtle.place)
  128. repeat turtle.digUp() until turtle.up()
  129. digWall(turtle.dig)
  130. buildWall(turtle.place)
  131.  
  132. turtle.turnRight()
  133. turtle.turnRight()
  134.  
  135. --third row
  136. for x = 1, width do
  137. clearLava(turtle.placeDown)
  138. turtle.digDown()
  139. clearLava(turtle.placeUp)
  140. turtle.digUp()
  141. repeat turtle.dig() until turtle.forward()
  142. end
  143.  
  144. clearLava(turtle.placeDown)
  145. turtle.digDown()
  146.  
  147.  
  148. digWall(turtle.dig)
  149. buildWall(turtle.place)
  150. repeat turtle.digUp() until turtle.up()
  151. digWall(turtle.dig)
  152. buildWall(turtle.place)
  153. repeat turtle.digUp() until turtle.up()
  154. digWall(turtle.dig)
  155. buildWall(turtle.place)
  156. repeat turtle.digUp() until turtle.up()
  157. digWall(turtle.dig)
  158. buildWall(turtle.place)
  159.  
  160. turtle.turnRight()
  161. turtle.turnRight()
  162.  
  163. --top row
  164. for x = 1, width do
  165. if digWall(turtle.digUp) ~= 1 then
  166. while true do
  167. if buildWall(turtle.placeUp) then
  168. break
  169. end
  170. turtle.digUp()
  171. end
  172. end
  173. clearLava(turtle.placeDown)
  174. turtle.digDown()
  175. repeat turtle.dig() until turtle.forward()
  176. end
  177.  
  178. if digWall(turtle.digUp) ~= 1 then
  179. while true do
  180. if buildWall(turtle.placeUp) then
  181. break
  182. end
  183. turtle.digUp()
  184. end
  185. end
  186. clearLava(turtle.placeDown)
  187. turtle.digDown()
  188.  
  189. digWall(turtle.dig)
  190. buildWall(turtle.place)
  191. repeat turtle.digDown() until turtle.down()
  192. digWall(turtle.dig)
  193. buildWall(turtle.place)
  194. repeat turtle.digDown() until turtle.down()
  195. digWall(turtle.dig)
  196. buildWall(turtle.place)
  197. repeat turtle.digDown() until turtle.down()
  198. digWall(turtle.dig)
  199. buildWall(turtle.place)
  200.  
  201. turtle.turnLeft()
  202. repeat turtle.dig() until turtle.forward()
  203. turtle.turnLeft()
  204. end
Advertisement
Add Comment
Please, Sign In to add comment