Energy Storage
High-level API
Device name:
energy_storageProvided 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():booleanGets whether energy can be taken out of the storage.
- Returns whether the storage allows extracting energy.
canReceiveEnergy():booleanGets whether energy can be put into the storage.
- Returns whether the storage allows receiving energy.
getEnergyStored():numberGets how much energy is currently stored.
- Returns the stored amount of energy.
getMaxEnergyStored():numberGets how much energy can be stored at most.
- Returns the capacity of the storage.