turtle.getFuelLevel
Returns a number representing the current amount of fuel (block moves) the turtle currently holds.
|
|||
| Get the amount of blocks a turtle can still move. | |||
| Code | print("We can still move", turtle.getFuelLevel(), "blocks before we run out of fuel!")
|
||
| Output | We can still move 9802 blocks before we run out of fuel!
|
||
|
|||
| Get the fuel level of a turtle in percentage of the max fuel holding capability, using turtle.getFuelLimit(). | |||
| Code | print("Fuel level is: ", ( turtle.getFuelLevel() / turtle.getFuelLimit() ) * 100, "%")
|
||
| Output | Fuel level is: 9.802 %
|
||
Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Lua |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CC:Tweaked |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| turtle.getFuelLevel Function | |
|---|---|
|
Syntax turtle.getFuelLevel() | |
| Returns | number fuel |
| API | turtle |
| Source | CC:Tweaked |
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.