Difference between revisions of "Turtle.refuel"
From ComputerCraft Wiki
SuicidalSTDz (Talk | contribs) m (Added integer tag and prettied up the arg description) |
(Changing int to number) |
||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=turtle.refuel | |name=turtle.refuel | ||
− | |args={{type| | + | |args={{type|number}} amount of fuel items in current slot to consume |
|api=turtle | |api=turtle | ||
− | |returns= | + | |returns={{type|boolean}} true if fuel, else false. |
|addon=ComputerCraft | |addon=ComputerCraft | ||
|desc=Fills the turtle with fuel. | |desc=Fills the turtle with fuel. |
Revision as of 14:46, 18 July 2013
Function turtle.refuel | |
Fills the turtle with fuel. | |
Syntax | turtle.refuel(number amount of fuel items in current slot to consume) |
Returns | boolean true if fuel, else false. |
Part of | ComputerCraft |
API | turtle |
Examples
Example | |
Fills the turtle with fuel | |
Code |
turtle.refuel( 4 ) |
Output | Tries to refuel with up to 4 items, returns true if it is a fuel and false if not. |
Example | |
Used in the command-line, the below code will tell the turtle to fuel itself using all inventory slots (1, 16) | |
Code |
refuel all |
Output | To complete |
Fuel Values
Fuel values for different items.
Item | Movement gained | Added by |
---|---|---|
Biofuel Can | 520 | IndustrialCraft |
Scrap | 15 | IndustrialCraft |
Coalfuel Can | 1520 | IndustrialCraft |
Wooden Scaffolding | 15 | IndustrialCraft |
Peat | 80 | Forestry |
Sugar Cane | 0 | Vanilla |
Wooden Tools | 10 | Vanilla |
Lava | 1000 | Vanilla |
Blaze Rod | 120 | Vanilla |
Wood Blocks | 15 | Vanilla |
Sticks | 5 | Vanilla |
Coal/Charcoal | 80 | Vanilla |
Mushroom Blocks | 15 | Vanilla |
Coal Coke | 320 | Railcraft |
1.41:
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.
1.42+:
Formula changed to ((fuel * 6) / 100). This will give more accurate movement values.
1.48:
Formula changed to ((fuel * 5) / 100)