Private
Public Access
1
0

Add train stats export option and update version to 0.1.18

This commit is contained in:
Jan Grießhaber
2026-01-03 18:16:48 +01:00
parent 0147851e7d
commit 34629509c3
3 changed files with 7 additions and 2 deletions

View File

@@ -59,6 +59,7 @@ script.on_init(function ()
options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value
options.enableResearch = settings.global["factorio-metrics-exporter-export_research_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.enableRobots = settings.global["factorio-metrics-exporter-export_logistic_stats"].value
options.enableTrains = settings.global["factorio-metrics-exporter-export_train_stats"].value
end) end)
@@ -77,6 +78,7 @@ script.on_load(function ()
options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value
options.enableResearch = settings.global["factorio-metrics-exporter-export_research_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.enableRobots = settings.global["factorio-metrics-exporter-export_logistic_stats"].value
options.enableTrains = settings.global["factorio-metrics-exporter-export_train_stats"].value
end) end)
script.on_configuration_changed(function() 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 if event.setting == "factorio-metrics-exporter-export_research_stats" then
options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value
end end
if event.setting == "factorio-metrics-exporter-export_train_stats" then
options.enableTrains = settings.global["factorio-metrics-exporter-export_train_stats"].value
end
end) end)

View File

@@ -1,6 +1,6 @@
{ {
"name": "factorio-metrics-exporter", "name": "factorio-metrics-exporter",
"version": "0.1.17", "version": "0.1.18",
"title": "Prometheus Metrics Exporter", "title": "Prometheus Metrics Exporter",
"author": "Jan Grießhaber", "author": "Jan Grießhaber",
"contact": "jan@griesshaber.systems", "contact": "jan@griesshaber.systems",

View File

@@ -19,7 +19,7 @@ end
function GetLogisticNetworkContents() function GetLogisticNetworkContents()
local resultParts = {} local resultParts = {}
resultParts[#resultParts+1] = "---logistic-grids-contents---\n" resultParts[#resultParts+1] = "---logistic-grids-contents---\n"
for _,surface in pairs(game.surfaces) do for _,surface in pairs(game.surfaces) do
local grids = game.forces["player"].logistic_networks[surface.name] local grids = game.forces["player"].logistic_networks[surface.name]
for _,grid in pairs(grids) do for _,grid in pairs(grids) do