Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hasRefuelled = false
- tank = turtle.getFuelLevel()
- function refuel(x)
- if tonumber(x) == 1 then
- display = true
- else
- display = false
- end
- if tank < 200 then
- for slot = 16,1,-1 do
- turtle.select(slot)
- hasRefuelled = turtle.refuel(slot)
- if hasRefuelled == true then
- if display == true then
- print("Refuelled.")
- end
- return true
- end
- if slot == 1 then
- if display == true then
- print("Out of fuel!")
- end
- return false
- end
- end
- else
- if displau == true then
- print("No fuel needed.")
- end
- return false
- end
- end
Add Comment
Please, Sign In to add comment