Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local height = 0
- local start = 0
- local function fuel()
- if turtle.getFuelLevel() < 100 then
- turtle.select(15)
- numero = turtle.getItemCount(15)
- if numero == 1 then
- toSurface()
- print "error"
- error()
- else
- turtle.refuel(numero-1)
- fuel()
- end
- end
- end
- function toSurface()
- turtle.select(4)
- while height < start do
- while turtle.detectUp() do
- if turtle.compareUp() then
- suckChestUp()
- end
- turtle.digUp()
- end
- turtle.up()
- height = height+1
- end
- end
- function inventoryFull()
- local exit = true
- for i=1, 16 do
- if turtle.getItemCount(i) == 0 then
- exit = false
- end
- end
- return exit
- end
- function suckChestUp()
- repeat
- if inventoryFull() then
- print "pru"
- turtle.digDown()
- turtle.select(16)
- turtle.placeDown()
- for i=5, 14 do
- turtle.select(i)
- turtle.dropDown()
- end
- sleep(5)
- turtle.select(16)
- turtle.digDown()
- turtle.select(4)
- suckChestUp()
- else
- salida = turtle.suckUp()
- end
- until salida == false
- end
- prueba = tonumber(read())
- start = prueba
- height = prueba-4
- fuel()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement