Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- definitions
- function checkLavaAndFuel()
- local fuelLimit = turtle.getFuelLimit()
- if turtle.getFuelLevel() < fuelLimit - 1000 then
- turtle.select(15)
- if turtle.place() then
- if not turtle.refuel() then
- -- we picked up something other than lava (water, etc.)
- turtle.place()
- end
- end
- end
- end
- function autoRefuel()
- checkLavaAndFuel()
- local fuelLimit = turtle.getFuelLimit()
- while turtle.getFuelLevel() < 80 do
- turtle.select(16)
- if turtle.refuel(0) then
- -- we can refuel using slot 16
- turtle.refuel(1)
- end
- end
- end
- function isFull()
- if turtle.getItemCount(12) > 0 then
- return true
- else
- return false
- end
- end
- -- start
- pos_x = 0
- while not isFull() do
- autoRefuel()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- pos_x = pos_x + 1
- while turtle.detectUp() do
- turtle.digUp()
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- while pos_x > 0 do
- autoRefuel()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- pos_x = pos_x - 1
- while turtle.detectUp() do
- turtle.digUp()
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1, 14 do
- turtle.select(i)
- turtle.dropDown()
- end
Add Comment
Please, Sign In to add comment