Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local prefix = "[Carlos 0.1a] "
- -- Funcao printf
- local function printf(...) print(string.format(...)) end
- -- Funcao combustivel
- local function combustivel()
- local restante = turtle.getFuelLevel() -- Combustivel restante
- if restante == 0 then
- printf("%s Sem combustivel restante, tentando reabastecer.", prefix)
- for i = 1, 16 do
- turtle.select(i)
- if turtle.refuel(0) then
- local halfStack = math.ceil(turtle.getItemCount(i)/2)
- turtle.refuel(halfStack)
- end
- end
- else:
- printf("%s Combustivel restante: %s", prefix, restante)
- end
- end
- combustivel()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement