funkd0ct0r

Untitled

Oct 8th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. --coal in slot2, cobble in 1
  2. --BmGxztNt
  3.  
  4. width = 14-1
  5.  
  6. junk_blocks = "minecraft:cobblestone minecraft:dirt minecraft:gravel chisel:limestone chisel:marble"
  7.  
  8. function buildWall(func)
  9. if turtle.getItemCount(1) > 1 then
  10. return func()
  11. end
  12. return true
  13. end
  14.  
  15. function clearLava(func)
  16. if turtle.getItemCount(1) > 1 then
  17. return func()
  18. end
  19. return true
  20. end
  21.  
  22. turtle.turnLeft()
  23. while true do
  24.  
  25. --refueling
  26. turtle.select(2)
  27. while turtle.getFuelLevel() < 256 do
  28. if turtle.getItemCount(2) > 1 then
  29. turtle.refuel(1)
  30. end
  31. sleep(0.5)
  32. end
  33. turtle.select(1)
  34.  
  35. --clear inventory
  36. local lastSlot = 3
  37. local slot = 3
  38. for slot = 16, 3, -1 do
  39. if turtle.getItemCount(slot) > 0 then
  40. lastSlot = slot
  41. break
  42. end
  43. end
  44. while slot < lastSlot do
  45. turtle.select(slot)
  46. data = turtle.getItemDetail(slot)
  47. if turtle.compareTo(1) or (data and junk_blocks:find(data.name)) then
  48. turtle.drop()
  49. turtle.select(lastSlot)
  50. turtle.transferTo(slot)
  51. lastSlot = lastSlot - 1
  52. slot = slot - 1
  53. end
  54. slot = slot + 1
  55. end
  56. while turtle.getItemCount(16) > 0 do
  57. sleep(1)
  58. end
  59. turtle.select(1)
  60.  
  61. --tunnel bore
  62. for x = 1, width do
  63. turtle.digDown()
  64. buildWall(turtle.placeDown)
  65. clearLava(turtle.placeUp)
  66. turtle.digUp()
  67. repeat turtle.dig() until turtle.forward()
  68. end
  69.  
  70. turtle.digDown()
  71. buildWall(turtle.placeDown)
  72. clearLava(turtle.placeUp)
  73. turtle.digUp()
  74.  
  75. turtle.dig()
  76. buildWall(turtle.place)
  77. repeat turtle.digUp() until turtle.up()
  78. turtle.dig()
  79. buildWall(turtle.place)
  80. repeat turtle.digUp() until turtle.up()
  81. turtle.dig()
  82. buildWall(turtle.place)
  83. repeat turtle.digUp() until turtle.up()
  84. turtle.dig()
  85. buildWall(turtle.place)
  86.  
  87. turtle.turnRight()
  88. turtle.turnRight()
  89.  
  90. for x = 1, width do
  91. repeat turtle.digUp() until buildWall(turtle.placeUp)
  92. clearLava(turtle.placeDown)
  93. turtle.digDown()
  94. repeat turtle.dig() until turtle.forward()
  95. end
  96.  
  97. repeat turtle.digUp() until buildWall(turtle.placeUp)
  98. clearLava(turtle.placeDown)
  99. turtle.digDown()
  100.  
  101. turtle.dig()
  102. buildWall(turtle.place)
  103. repeat turtle.digDown() until turtle.down()
  104. turtle.dig()
  105. buildWall(turtle.place)
  106. repeat turtle.digDown() until turtle.down()
  107. turtle.dig()
  108. buildWall(turtle.place)
  109. repeat turtle.digDown() until turtle.down()
  110. turtle.dig()
  111. buildWall(turtle.place)
  112.  
  113. turtle.turnLeft()
  114. repeat turtle.dig() until turtle.forward()
  115. turtle.turnLeft()
  116. end
Advertisement
Add Comment
Please, Sign In to add comment