Turtle.getFuelLevel

From ComputerCraft Wiki
Revision as of 18:53, 28 November 2012 by AfterLifeLochie (Talk | contribs) (Moved to CAT:LuaCoreFunctions)

Jump to: navigation, search
Function turtle.getFuelLevel
Syntax turtle.getFuelLevel()
Returns "unlimited" if fuel is disabled, otherwise the fuel level.
Part of ComputerCraft
API turtle
Description Returns the fuel level.

Examples

Description Fills the turtle with fuel if the fuel tank is empty
Code
if turtle.getFuelLevel() < 1 then
 turtle.refuel()
end
Output Checks if the fuel tank is empty, if it is, it will fill the tank, otherwise it won't do anything.