Page 1 of 1

Quality support for LuaFlowStatistics?

Posted: Wed Nov 27, 2024 6:36 pm
by VinDust
Example:
Im trying to get electric network charge and capacity

electric_network have 2 common accumulator, 4 legendary accumulators and 10 rare accumulators

LuaFlowStatistics.get_flow_count{id="accumulator", ..., count=true} returns 2 (Count of common accumulators) (need for calculating capacity)
LuaFlowStatistics.get_flow_count{id="accumulator", ..., count=false} returns 10 MJ (Current charge of 2 common accumulators)

local charge_delta = LuaFlowStatistics.storage_counts["accumulator"] - <previous charge value>
local tick_delta = game.tick - <prev tick>
charge_delta / tick_delta returns 79 MJ (Current charge of 4 legendary accumulators)

Am I doing something wrong?