Added Reserach Stats, still have to add power and research avg
This commit is contained in:
10
control.lua
10
control.lua
@@ -4,7 +4,6 @@ require("pollution-stats")
|
||||
require("research-stats")
|
||||
require("power-stats")
|
||||
require("logistic-network-stats")
|
||||
require("storage")
|
||||
|
||||
tickInterval = tonumber(settings.global["factorio-prometheus-exporter-tick-interval"].value) or 300
|
||||
udpAddress = tonumber(settings.startup["factorio-prometheus-exporter-udp-address"].value) or 52555
|
||||
@@ -16,6 +15,9 @@ script.on_init(function ()
|
||||
storage.electricGrids = {}
|
||||
storage.researchedTechnologies = {}
|
||||
storage.playerDeathCount = {}
|
||||
storage.totalLabCount = 0
|
||||
storage.totalResearchSpeed = 0
|
||||
storage.totalReseachProductivity = 0
|
||||
end)
|
||||
|
||||
script.on_load(function ()
|
||||
@@ -26,6 +28,7 @@ end)
|
||||
|
||||
|
||||
|
||||
|
||||
-- Register the handler for the player movement event
|
||||
script.on_event(defines.events.on_player_died, function(event)
|
||||
local player = game.get_player(event.player_index)
|
||||
@@ -69,14 +72,15 @@ function SendAll(event)
|
||||
isInitialized = true
|
||||
|
||||
|
||||
if (event.tick % math.floor(tickInterval/4) ~= 0) then return end
|
||||
if (event.tick % math.floor(tickInterval/6) ~= 0) then return end
|
||||
|
||||
sendIndex = (sendIndex % 5) + 1
|
||||
sendIndex = (sendIndex % 6) + 1
|
||||
if sendIndex == 1 then SendProductionStats() end
|
||||
if sendIndex == 2 then SendPollutionStats() end
|
||||
if sendIndex == 3 then SendKillStats() end
|
||||
if sendIndex == 4 then SendFluidProductionStats() end
|
||||
if sendIndex == 5 then SendBuildStats() end
|
||||
if sendIndex == 6 then SendResearchStats() end
|
||||
|
||||
if(event.tick % tickInterval*2 == 0) then SendGameStats(event) end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user