Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --coal in slot2, cobble in 1
- --fGEJmTvf
- width = 14-1
- junk_blocks = "minecraft:cobblestone minecraft:dirt minecraft:gravel chisel:limestone chisel:marble"
- function digWall(func)
- local inspect = turtle.inspect
- if func == turtle.digUp then
- inspect = turtle.inspectUp
- end
- if func == turtle.digDown then
- inspect = turtle.inspectDown
- end
- local s,d = inspect()
- if s and d and (d.name == "minecraft:stone" or d.name == "minecraft:cobblestone") then
- return 1
- end
- return func()
- end
- function buildWall(func)
- if turtle.getItemCount(1) > 1 then
- return func()
- end
- return true
- end
- function clearLava(func)
- if turtle.getItemCount(1) > 1 then
- return func()
- end
- return true
- end
- turtle.turnLeft()
- while true do
- --refueling
- turtle.select(2)
- while turtle.getFuelLevel() < 256 do
- if turtle.getItemCount(2) > 1 then
- turtle.refuel(1)
- end
- sleep(0.5)
- end
- turtle.select(1)
- --clear inventory
- local lastSlot = 3
- local slot = 3
- for slot = 16, 3, -1 do
- if turtle.getItemCount(slot) > 0 then
- lastSlot = slot
- break
- end
- end
- while slot < lastSlot do
- turtle.select(slot)
- data = turtle.getItemDetail(slot)
- if turtle.compareTo(1) or (data and junk_blocks:find(data.name)) then
- turtle.drop()
- turtle.select(lastSlot)
- turtle.transferTo(slot)
- lastSlot = lastSlot - 1
- slot = slot - 1
- end
- slot = slot + 1
- end
- while turtle.getItemCount(16) > 0 do
- sleep(1)
- end
- turtle.select(1)
- --tunnel bore
- --first row
- for x = 1, width do
- digWall(turtle.digDown)
- buildWall(turtle.placeDown)
- clearLava(turtle.placeUp)
- turtle.digUp()
- repeat turtle.dig() until turtle.forward()
- end
- digWall(turtle.digDown)
- buildWall(turtle.placeDown)
- clearLava(turtle.placeUp)
- turtle.digUp()
- digWall(turtle.dig)
- buildWall(turtle.place)
- repeat turtle.digUp() until turtle.up()
- digWall(turtle.dig)
- buildWall(turtle.place)
- repeat turtle.digUp() until turtle.up()
- digWall(turtle.dig)
- buildWall(turtle.place)
- repeat turtle.digUp() until turtle.up()
- digWall(turtle.dig)
- buildWall(turtle.place)
- turtle.turnRight()
- turtle.turnRight()
- --second row
- for x = 1, width do
- clearLava(turtle.placeDown)
- turtle.digDown()
- clearLava(turtle.placeUp)
- turtle.digUp()
- repeat turtle.dig() until turtle.forward()
- end
- clearLava(turtle.placeDown)
- turtle.digDown()
- digWall(turtle.dig)
- buildWall(turtle.place)
- repeat turtle.digUp() until turtle.up()
- digWall(turtle.dig)
- buildWall(turtle.place)
- repeat turtle.digUp() until turtle.up()
- digWall(turtle.dig)
- buildWall(turtle.place)
- repeat turtle.digUp() until turtle.up()
- digWall(turtle.dig)
- buildWall(turtle.place)
- turtle.turnRight()
- turtle.turnRight()
- --third row
- for x = 1, width do
- clearLava(turtle.placeDown)
- turtle.digDown()
- clearLava(turtle.placeUp)
- turtle.digUp()
- repeat turtle.dig() until turtle.forward()
- end
- clearLava(turtle.placeDown)
- turtle.digDown()
- digWall(turtle.dig)
- buildWall(turtle.place)
- repeat turtle.digUp() until turtle.up()
- digWall(turtle.dig)
- buildWall(turtle.place)
- repeat turtle.digUp() until turtle.up()
- digWall(turtle.dig)
- buildWall(turtle.place)
- repeat turtle.digUp() until turtle.up()
- digWall(turtle.dig)
- buildWall(turtle.place)
- turtle.turnRight()
- turtle.turnRight()
- --top row
- for x = 1, width do
- if digWall(turtle.digUp) ~= 1 then
- while true do
- if buildWall(turtle.placeUp) then
- break
- end
- turtle.digUp()
- end
- end
- clearLava(turtle.placeDown)
- turtle.digDown()
- repeat turtle.dig() until turtle.forward()
- end
- if digWall(turtle.digUp) ~= 1 then
- while true do
- if buildWall(turtle.placeUp) then
- break
- end
- turtle.digUp()
- end
- end
- clearLava(turtle.placeDown)
- turtle.digDown()
- for z = 1, 9 do
- digWall(turtle.dig)
- buildWall(turtle.place)
- repeat turtle.digDown() until turtle.down()
- end
- digWall(turtle.dig)
- buildWall(turtle.place)
- turtle.turnLeft()
- repeat turtle.dig() until turtle.forward()
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment