Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 2-Wide Vertical Shaft Digger (2 blocks wide, 1 block long)
- -- Digs entire 2-wide shaft first, then places ladders on left side while returning
- -- Slot 1: Ladders | Slot 2: Cobblestone (backing/lava protection)
- function refuelIfNeeded(minFuel)
- if turtle.getFuelLevel() == "unlimited" then return true end
- while turtle.getFuelLevel() < minFuel do
- for i = 3, 16 do
- turtle.select(i)
- if turtle.refuel(1) then break end
- end
- if turtle.getFuelLevel() < minFuel then
- print("Add more fuel...")
- os.sleep(2)
- end
- end
- end
- function digShaft(depth)
- for i = 1, depth do
- -- Dig right column (main position)
- while turtle.detectDown() do turtle.digDown() sleep(0.1) end
- -- Move left and dig left column
- turtle.turnLeft()
- turtle.forward()
- while turtle.detectDown() do turtle.digDown() sleep(0.1) end
- -- Descend both columns
- turtle.down() -- Left side
- turtle.back()
- turtle.turnRight()
- turtle.down() -- Right side
- -- Check for lava and protect
- local success, data = turtle.inspectDown()
- if success and data.name == "minecraft:lava" then
- turtle.select(2)
- turtle.placeDown()
- end
- end
- end
- function placeLadders(depth)
- -- Position turtle on left side at bottom
- turtle.turnLeft()
- turtle.forward()
- for i = 1, depth do
- -- Ensure cobblestone backing exists
- if not turtle.inspect() then
- turtle.select(2)
- turtle.place() -- Place backing
- end
- -- Place ladder from below
- turtle.select(1)
- turtle.placeDown()
- -- Ascend to next level
- while not turtle.up() do
- turtle.digUp()
- sleep(0.1)
- end
- end
- -- Return to right side and ascend to surface
- turtle.back()
- turtle.turnRight()
- for i = 1, depth do
- while not turtle.up() do
- turtle.digUp()
- sleep(0.1)
- end
- end
- end
- -- === MAIN PROGRAM ===
- print("Enter shaft depth:")
- local depth = tonumber(read())
- if not depth or depth < 1 then
- print("Invalid depth")
- return
- end
- refuelIfNeeded(depth * 10 + 20) -- Extra fuel buffer
- print("Digging 2-wide shaft...")
- digShaft(depth)
- print("Placing ladders on left side...")
- placeLadders(depth)
- print("✅ 2-wide ladder shaft complete!")
Advertisement
Add Comment
Please, Sign In to add comment