-
Notifications
You must be signed in to change notification settings - Fork 5
Lua API
Vlad Marica edited this page Jun 24, 2020
·
1 revision
This mod has support for OpenComputers, ComputerCraft, and CC:Tweaked. Connecting a computer to an energy meter exposes the following Lua API for querying and controlling it.
Function | Description |
---|---|
getTransferRate():number |
Gets the current energy transfer rate per tick |
getTotalEnergyTransferred():number |
Gets to the total amount of energy that has passed through the meter |
getStatus():string |
Gets the current status of the meter, either "active" , "not_connected" , or "disabled"
|
getRedstoneControlState():string |
Gets the redstone control state of the meter, either "active" , "inverted" , or "ignored"
|
getEnergyType():string |
Gets the energy type this meter supports, either "FE" , "MJ" , or "EU"
|
getEnergyTypeAlias():string |
Gets the energy type alias for the meter. For example, may return "FE" or "RF" for an FE meter |
getTransferRateLimit():number |
Returns the current transfer rate limit or -1 if it is unlimited |
setTransferRateLimit(limit:number):bool |
Attempts to set the transfer rate limit for this meter. Pass -1 to set it to unlimited. Returns a boolean indicating if the operation was successful. |