Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sleepTime = 10
- local fuelSlot = 16
- print("Place fuel in slot " ..fuelSlot)
- function digForward()
- while turtle.forward() == false do
- if turtle.dig() == false then
- turtle.attack()
- end
- end
- end
- function emptyInv()
- local suc, chest = turtle.inspect()
- if chest.name == "minecraft:chest" or chest.name == "minecraft:trapped_chest" then
- print("chest found")
- for i=1,15 do
- turtle.select(i)
- turtle.drop(turtle.getItemCount(i))
- end
- end
- end
- function refuelMe()
- print(turtle.getFuelLevel())
- turtle.select(fuelSlot)
- while turtle.getFuelLevel() < 1000 do
- if turtle.getItemCount(fuelSlot) <= 0 then
- print("low fuel")
- end
- turtle.refuel(1)
- end
- end
- while true do
- digForward()
- local success, border = turtle.inspectDown()
- if border.name == "minecraft:wool" then
- emptyInv()
- refuelMe()
- turtle.turnRight()
- turtle.turnRight()
- print("Going to sleep for " ..sleepTime.. " seconds")
- sleep(sleepTime)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement