This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Clem2095's profile picture

[Turtle] Fuel Consumption

Started by Clem2095, 26 July 2013 - 12:30 AM
Clem2095 #1
Posted 26 July 2013 - 02:30 AM
Hellow,

I have just read the turtle.refuel() page on the wiki and understood how the fuel 'recharge' does work.

However, I think at least one information is missing (or did I miss it?):
I would like to know which operation do cost fuel for a turtle, I assume it is only the movement (to move from block A to block B)/> and not any other action like digging, breaking block, detect, etc.

Is my assumption right?
Sharidan #2
Posted 26 July 2013 - 02:37 AM
There are only four movement calls to the turtle that spend fuel:

turtle.forward()
turtle.back()
turtle.up()
turtle.down()

All other functions do not take up any fuel, so you can turn, dig, compare, swap around inventory contents on an empty fuel tank all you want and it'll still work.

turtle.getFuelLevel() reports a number back. The current fuel level. This number indicates directly how many total moves the turtle has left - i.e. how many times you can call the 4 movement functions. One piece of coal yields some 80 movement points or so.
Clem2095 #3
Posted 26 July 2013 - 03:20 AM
Thanks that's perfect!
I was about to write a code which call getFueldLevel() call all possible functions and getFuelLevle() again to verify, but even better :)/>

Thanks again!

Note: Maybe it would be useful to add it in the wiki as well!
campicus #4
Posted 26 July 2013 - 03:52 AM
The wiki sort of does say:

"[turtle.getFuelLevel()] … Returns the current fuel level of the turtle, this is the number of blocks the turtle can move"