funkd0ct0r

Untitled

Jun 24th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. --coal in slot2, cobble in 1
  2. --
  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. for x = 1, width do
  78. digWall(turtle.digDown)
  79. buildWall(turtle.placeDown)
  80. clearLava(turtle.placeUp)
  81. turtle.digUp()
  82. repeat turtle.dig() until turtle.forward()
  83. end
  84.  
  85. digWall(turtle.digDown)
  86. buildWall(turtle.placeDown)
  87. clearLava(turtle.placeUp)
  88. turtle.digUp()
  89.  
  90. digWall(turtle.dig)
  91. buildWall(turtle.place)
  92. repeat turtle.digUp() until turtle.up()
  93. digWall(turtle.dig)
  94. buildWall(turtle.place)
  95. repeat turtle.digUp() until turtle.up()
  96. digWall(turtle.dig)
  97. buildWall(turtle.place)
  98. repeat turtle.digUp() until turtle.up()
  99. digWall(turtle.dig)
  100. buildWall(turtle.place)
  101.  
  102. turtle.turnRight()
  103. turtle.turnRight()
  104.  
  105. for x = 1, width do
  106. if digWall(turtle.digUp) ~= 1 then
  107. while true do
  108. if buildWall(turtle.placeUp) then
  109. break
  110. end
  111. turtle.digUp()
  112. end
  113. end
  114. clearLava(turtle.placeDown)
  115. turtle.digDown()
  116. repeat turtle.dig() until turtle.forward()
  117. end
  118.  
  119. if digWall(turtle.digUp) ~= 1 then
  120. while true do
  121. if buildWall(turtle.placeUp) then
  122. break
  123. end
  124. turtle.digUp()
  125. end
  126. end
  127. clearLava(turtle.placeDown)
  128. turtle.digDown()
  129.  
  130. digWall(turtle.dig)
  131. buildWall(turtle.place)
  132. repeat turtle.digDown() until turtle.down()
  133. digWall(turtle.dig)
  134. buildWall(turtle.place)
  135. repeat turtle.digDown() until turtle.down()
  136. digWall(turtle.dig)
  137. buildWall(turtle.place)
  138. repeat turtle.digDown() until turtle.down()
  139. digWall(turtle.dig)
  140. buildWall(turtle.place)
  141.  
  142. turtle.turnLeft()
  143. repeat turtle.dig() until turtle.forward()
  144. turtle.turnLeft()
  145. end
Advertisement
Add Comment
Please, Sign In to add comment