|If the currently selected slot contains fuel items, it will consume them to give the turtle the ability to move. If the current slot doesn't contain fuel items, it returns false. If a quantity is specified, it will refuel only up to that many items. If the avaiable items quantity is lower than the specified, only the avaiable quantity will be consumed, because it can't consume what doesn't exist. If no quantity is specified, it will consume all the items in the slot. Turtles loose all the fuel when broken if they don't have a label.|
As of ComputerCraft 1.6, turtles may no longer store practically unlimited amounts of fuel. Attempting to refuel past a given turtle's limit with this command will destroy the items regardless, but fails to raise the fuel level higher than maximum and returns no error.
|Syntax||turtle.refuel(number fuel item consume quantity (optional))|
|Returns||boolean true if fueled, else false.|
|Checks if the item in the current slot can be used as fuel without consuming it|
local valid = turtle.refuel(0) print(valid)
|Output||If the current slot is valid fuel|
|Consumes only 4 items in the current slot if the item is a valid fuel|
local success = turtle.refuel(4) print(success)
|Output||whether it successfully refuelled|
Fuel values for some different items. Note that other items are accepted (including both vanilla / mod items) - generally, if an item can be used in a furnace it'll provide fuel equal to the number of items it could smelt, multiplied by ten.
Every movement a turtle performs consumes one fuel unit. Actions that can be performed while the turtle is stationary do not consume fuel.
|Item||Movement gained||Added by|
The formula for calculating the movement gain from a fuel is "((fuel / 100) * 6)". Where fuel is the items burn time in ticks in a regular furnace and "/" is integer division.
Formula changed to ((fuel * 6) / 100). This will give more accurate movement values.
Formula changed to ((fuel * 5) / 100)