Quality support for LuaFlowStatistics?

Place to get help with not working mods / modding interface.
VinDust
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Nov 27, 2024 6:00 pm
Contact:

Quality support for LuaFlowStatistics?

Post 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?
Post Reply

Return to “Modding help”