2 posts
Location
Austria
Posted 15 April 2014 - 08:30 PM
Hello fellow guys,
as the title says, I want to know how I can save the fuel level of a mining turtle as a variable (if this is possible).
I'm using "TurtleOS 1.5" in Tekkit Lite.
Thanks for all answers
1281 posts
Posted 15 April 2014 - 09:36 PM
turtle.getFuelLevel()
returns the current amount of fuel.
7083 posts
Location
Tasmania (AU)
Posted 15 April 2014 - 11:23 PM
And this:
local fuelLevel = turtle.getFuelLevel()
… stores it in a variable.
Note that what's stored is a number representing the amount of fuel the turtle has at the time turtle.getFuelLevel() was called. That variable won't automatically update, so you'll need to check it again every once and a while if you want to keep track of it.
2 posts
Location
Austria
Posted 16 April 2014 - 11:16 AM
And this:
local fuelLevel = turtle.getFuelLevel()
… stores it in a variable.
Note that what's stored is a number representing the amount of fuel the turtle has at the time turtle.getFuelLevel() was called. That variable won't automatically update, so you'll need to check it again every once and a while if you want to keep track of it.
Ok thanks. That's it what I've been looking for ^^