Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Requires:
- -- mining turtle
- -- Slot 1, Coal
- -- Slot 2, Stairs if you want him to place Stairs
- function digMyStairs()
- local action=true
- local steps=0
- NeedFuel()
- turtle.forward()
- turtle.digDown()
- turtle.down()
- while action do
- local success, data = turtle.inspectDown()
- if success then
- if data.name~="minecraft:bedrock" then
- steps=steps+1
- for i=1 , 4 do
- turtle.dig()
- turtle.forward()
- end
- for i=1 , 3 do
- turtle.back()
- end
- turtle.digDown()
- turtle.down()
- else action=false
- placeStairs(steps)
- end
- else action=false
- end
- end
- end
- function placeStairs(s)
- turtle.select(2)
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.up()
- turtle.placeDown()
- for i=1 , s do
- turtle.up()
- turtle.forward()
- turtle.placeDown()
- end
- turtle.forward()
- end
- function NeedFuel()
- if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 1 then
- turtle.select(1)
- if turtle.refuel() then
- print("Fuel level is: ", ( turtle.getFuelLevel() / turtle.getFuelLimit() ) * 100, "%")
- else
- print("Can't refuel ,Place some Coal in the 1st Slot")
- end
- else print("Fuel level is: ", ( turtle.getFuelLevel() / turtle.getFuelLimit() ) * 100, "%","We can still move", turtle.getFuelLevel(), "blocks")
- end
- end
- digMyStairs()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement