diff --git a/control.lua b/control.lua index b1fd6d0..99f56ff 100644 --- a/control.lua +++ b/control.lua @@ -34,7 +34,7 @@ script.on_init(function () storage.labs = {} sendIndex = 0 - options.enableMod = settings.global["factorio-prometheus-exporter-exporter_enable"].value + options.enableMod = settings.global["factorio-prometheus-exporter-enable"].value options.enableProduction = settings.global["factorio-prometheus-exporter-export_production_stats"].value options.enablePollution = settings.global["factorio-prometheus-exporter-export_pollution_stats"].value options.enableFluid = settings.global["factorio-prometheus-exporter-export_fluid_stats"].value @@ -42,7 +42,7 @@ script.on_init(function () options.enableKills = settings.global["factorio-prometheus-exporter-export_kill_stats"].value options.enablePower = settings.global["factorio-prometheus-exporter-export_power_stats"].value options.enableResearch = settings.global["factorio-prometheus-exporter-export_research_stats"].value - options.enableRobots = settings.global["factorio-prometheus-exporter_export_logistic_stats"].value + options.enableRobots = settings.global["factorio-prometheus-exporter-export_logistic_stats"].value end) @@ -52,7 +52,7 @@ script.on_load(function () log("tickInterval: "..tickInterval) log("udpAddress: "..udpAddress) - options.enableMod = settings.global["factorio-prometheus-exporter-exporter_enable"].value + options.enableMod = settings.global["factorio-prometheus-exporter-enable"].value options.enableProduction = settings.global["factorio-prometheus-exporter-export_production_stats"].value options.enablePollution = settings.global["factorio-prometheus-exporter-export_pollution_stats"].value options.enableFluid = settings.global["factorio-prometheus-exporter-export_fluid_stats"].value @@ -60,11 +60,10 @@ script.on_load(function () options.enableKills = settings.global["factorio-prometheus-exporter-export_kill_stats"].value options.enablePower = settings.global["factorio-prometheus-exporter-export_power_stats"].value options.enableResearch = settings.global["factorio-prometheus-exporter-export_research_stats"].value - options.enableRobots = settings.global["factorio-prometheus-exporter_export_logistic_stats"].value + options.enableRobots = settings.global["factorio-prometheus-exporter-export_logistic_stats"].value end) script.on_configuration_changed(function() - storage.electricGrids = storage.electricGrids or {} storage.labs = storage.labs or {} storage.playerDeathCount = storage.playerDeathCount or {} @@ -72,7 +71,6 @@ script.on_configuration_changed(function() storage.totalLabCount = storage.totalLabCount or 0 storage.totalReseachProductivity = storage.totalReseachProductivity or 0 storage.totalResearchSpeed = storage.totalResearchSpeed or 0 - end ) @@ -110,7 +108,6 @@ script.on_event(defines.events.on_runtime_mod_setting_changed, function(event) options.enablePlayers = settings.global["factorio-prometheus-exporter-export_player_stats"].value end - if event.setting == "factorio-prometheus-exporter-export_kill_stats" then options.enableKills = settings.global["factorio-prometheus-exporter-export_kill_stats"].value end @@ -187,3 +184,4 @@ script.on_event(defines.events.on_robot_mined_entity,PurgeNetworks,{{filter = "t + diff --git a/locale/de-DE/locale.cfg b/locale/de-DE/locale.cfg index e69de29..dfca58c 100644 --- a/locale/de-DE/locale.cfg +++ b/locale/de-DE/locale.cfg @@ -0,0 +1,6 @@ +[mod-setting-name] +factorio-prometheus-exporter-export_production_stats = Enable ProductionD +factorio-prometheus-exporter-export_logistic_stats=Enable LogisticsD +factorio-prometheus-exporter-export_pollution_stats=Enable PollutionD +[mod-setting-description] +factorio-prometheus-exporter-export_production_stats = Enables sending of the production statistics per surface. Not very expensive \ No newline at end of file diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index e69de29..4caac53 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -0,0 +1,26 @@ +[mod-setting-name] +factorio-prometheus-exporter-enable=Enable Mod +factorio-prometheus-exporter-tick-interval=Tick Interval +factorio-prometheus-exporter-udp-address=UDP Port +factorio-prometheus-exporter-export_production_stats=Enable Production +factorio-prometheus-exporter-export_fluid_stats=Enable Fluids +factorio-prometheus-exporter-export_logistic_stats=Enable Logistics +factorio-prometheus-exporter-export_pollution_stats=Enable Pollution +factorio-prometheus-exporter-export_kill_stats=Enable Kills +factorio-prometheus-exporter-export_research_stats=Enable Research +factorio-prometheus-exporter-export_power_stats=Enable Power +factorio-prometheus-exporter-export_player_stats=Enable Player +factorio-prometheus-exporter-export_train_stats=Enable Train +[mod-setting-description] +factorio-prometheus-exporter-export_production_stats=Enables sending of the production statistics per surface. Not very expensive +factorio-prometheus-exporter-enable=Enable sending of the UDP packets +factorio-prometheus-exporter-tick-interval=Set the tick interval at which metrics are collected +factorio-prometheus-exporter-udp-address=Choose a udp port to send the data to, must be enable with --enable-lua-udp when starting factorio. It is important to use a different port the target port! +factorio-prometheus-exporter-export_fluid_stats=Enables the sending of fluid production statistics. Not very expensive +factorio-prometheus-exporter-export_logistic_stats=Enables sending of logistic network statistics. Moderatly expensive +factorio-prometheus-exporter-export_pollution_stats=Enable sending of Pollution related statistics. Not very expensive +factorio-prometheus-exporter-export_kill_stats=Enable sending of kill statistics. Not very expensive +factorio-prometheus-exporter-export_research_stats=Enable sending of research statistics. Moderatly expensive +factorio-prometheus-exporter-export_power_stats=Enable Power. Not yet implemented! +factorio-prometheus-exporter-export_player_stats=Enable sending of player statistics +factorio-prometheus-exporter-export_train_stats=Enable sending of train statistics. Not yet implemented! \ No newline at end of file diff --git a/research-stats.lua b/research-stats.lua index a987fc3..bd055de 100644 --- a/research-stats.lua +++ b/research-stats.lua @@ -14,6 +14,7 @@ function GenerateLabInfo() end end end + LabsScanned = true end diff --git a/settings.lua b/settings.lua index 5b3a094..6868579 100644 --- a/settings.lua +++ b/settings.lua @@ -16,7 +16,7 @@ data:extend({ }, { type = "int-setting", - name = "factorio-prometheus-exporter-udp-address", + name = "factorio-prometheus-exporter-udp-port", setting_type = "startup", allow_blank = false, default_value = 52555, @@ -77,5 +77,13 @@ data:extend({ setting_type = "runtime-global", default_value = true, order = "i" + }, + { + type = "bool-setting", + name = "factorio-prometheus-exporter-export_train_stats", + setting_type = "runtime-global", + default_value = true, + order = "i" } + }) \ No newline at end of file