From 34629509c31640aad629d6e3935c132325fd8fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Grie=C3=9Fhaber?= Date: Sat, 3 Jan 2026 18:16:48 +0100 Subject: [PATCH] Add train stats export option and update version to 0.1.18 --- control.lua | 5 +++++ info.json | 2 +- logistic-network-stats.lua | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/control.lua b/control.lua index a5d0d89..6450cb3 100644 --- a/control.lua +++ b/control.lua @@ -59,6 +59,7 @@ script.on_init(function () options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value options.enableRobots = settings.global["factorio-metrics-exporter-export_logistic_stats"].value + options.enableTrains = settings.global["factorio-metrics-exporter-export_train_stats"].value end) @@ -77,6 +78,7 @@ script.on_load(function () options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value options.enableRobots = settings.global["factorio-metrics-exporter-export_logistic_stats"].value + options.enableTrains = settings.global["factorio-metrics-exporter-export_train_stats"].value end) script.on_configuration_changed(function() @@ -144,6 +146,9 @@ script.on_event(defines.events.on_runtime_mod_setting_changed, function(event) if event.setting == "factorio-metrics-exporter-export_research_stats" then options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value end + if event.setting == "factorio-metrics-exporter-export_train_stats" then + options.enableTrains = settings.global["factorio-metrics-exporter-export_train_stats"].value + end end) diff --git a/info.json b/info.json index 86ae913..efdd81e 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "factorio-metrics-exporter", - "version": "0.1.17", + "version": "0.1.18", "title": "Prometheus Metrics Exporter", "author": "Jan Grießhaber", "contact": "jan@griesshaber.systems", diff --git a/logistic-network-stats.lua b/logistic-network-stats.lua index b3323d6..d720903 100644 --- a/logistic-network-stats.lua +++ b/logistic-network-stats.lua @@ -19,7 +19,7 @@ end function GetLogisticNetworkContents() local resultParts = {} - resultParts[#resultParts+1] = "---logistic-grids-contents---\n" + resultParts[#resultParts+1] = "---logistic-grids-contents---\n" for _,surface in pairs(game.surfaces) do local grids = game.forces["player"].logistic_networks[surface.name] for _,grid in pairs(grids) do