Posted 17 September 2013 - 11:23 AM
im wondering if there is a way to detect if a move requires fuel without actually trying it, or will I have to put all moves that do in a table?
local function enoughFuel( required )
--# if the function doesn't exist exit the function
if not turtle.getFuelLevel then
return true
end
--# get the fuel level
local fuel = turtle.getFuelLevel()
--# return whether the fuel is unlimited or there is fuel to move
return fuel == "unlimited" or fuel >= required
end