Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p = peripheral.wrap("left")
- p.setShapeCircle(5)
- function getItemSlots()
- local slots = 16
- for i = 1, 16 do
- if turtle.getItemCount(i) > 0 then
- slots = slots - 1
- end
- end
- return slots
- end
- function autoRefuel()
- if turtle.getFuelLevel() <= 80 then
- turtle.refuel(1)
- end
- end
- function dropAllItems()
- for i = 1, 16 do
- turtle.select(i)
- turtle.drop()
- end
- end
- function dig()
- autoRefuel()
- while turtle.inspect() do
- turtle.dig()
- turtle.suck()
- os.sleep(0.5)
- end
- end
- function digUp()
- autoRefuel()
- while turtle.inspectUp() do
- turtle.digUp()
- turtle.suck()
- os.sleep(0.5)
- end
- end
- function digDown()
- autoRefuel()
- while turtle.inspectDown() do
- turtle.digDown()
- turtle.suck()
- os.sleep(0.5)
- end
- end
- while true do
- autoRefuel()
- while getItemSlots() > 0 do
- if turtle.inspect() then
- dig()
- turtle.turnRight()
- dig()
- turtle.turnLeft()
- turtle.turnLeft()
- dig()
- turtle.turnRight()
- digUp()
- turtle.up()
- dig()
- turtle.turnRight()
- dig()
- turtle.turnLeft()
- turtle.turnLeft()
- dig()
- turtle.turnRight()
- turtle.down()
- end
- turtle.forward()
- end
- --Turtle ran out of space
- turtle.turnRight()
- turtle.turnRight()
- --Turn Back
- while true do
- local _,data = turtle.inspect()
- if data.name == "IronChest:BlockIronChest" then break end
- autoRefuel()
- turtle.forward()
- end
- dropAllItems()
- turtle.turnRight()
- turtle.turnRight()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement