Get stats of accumulators on the network
Posted: Fri Jun 11, 2021 7:55 pm
Is there any way of getting information about the total accumulator charge of an electric network?
www.factorio.com
https://forums.factorio.com/
Code: Select all
electric_network_statistics
Code: Select all
local grid_id = <some_power-pole>.electric_network_id
local total_charge = 0
local accumulators = surface.find_entities_filtered{name = "accumulator"}
for _, i in ipairs(accumulators) do
if i.electric_network_id == grid_id then
total_charge = total_charge + i.energy
end
end
game.print(total_charge)
Maybe a good request for modding interface request section? Assuming that one does indeed not already exist.TheBigZet wrote: Wed Nov 24, 2021 8:51 pm You'd think thatwould be a solution to this problem, but apparently it can only give producers and consumers.Code: Select all
electric_network_statistics