Energy Storage

High-level API

Device name: energy_storage
Provided by any energy storage connected through a bus interface, such as a charger or the batteries of other mods. Amounts are in the energy unit of the mod, the same one robots use.
With several storages connected, find may return any of them. To grab a specific one, give the bus interface in front of the one you want a name with a wrench, and find it by that name instead.

Methods

canExtractEnergy():boolean
Gets whether energy can be taken out of the storage.
- Returns whether the storage allows extracting energy.
canReceiveEnergy():boolean
Gets whether energy can be put into the storage.
- Returns whether the storage allows receiving energy.
getEnergyStored():number
Gets how much energy is currently stored.
- Returns the stored amount of energy.
getMaxEnergyStored():number
Gets how much energy can be stored at most.
- Returns the capacity of the storage.