From 8ba72cee1ccd85f55adbeb3411709b331fc3004b Mon Sep 17 00:00:00 2001 From: Someone Date: Mon, 29 Jul 2019 03:48:58 +0200 Subject: [PATCH] Added fluid counts to log output + Release. --- changelog.txt | 7 +++++++ control.lua | 22 ++++++++++++++++++++++ info.json | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 7d0f676..70acd85 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.17.3 +Date: 2019-07-29 + + Changed: + - Added fluid counts to log output. + --------------------------------------------------------------------------------------------------- Version: 0.17.2 Date: 2019-06-01 diff --git a/control.lua b/control.lua index 845a24a..6891672 100644 --- a/control.lua +++ b/control.lua @@ -24,5 +24,27 @@ script.on_event(defines.events.on_tick, function(event) log("\t"..k.."\t"..prod.."\t"..(-cons).."\t"..(-lost).."\t"..(prod-cons-lost)) end end + + for k, prod in pairs(f.fluid_production_statistics.input_counts) do + local cons = 0 + local lost = 0 + if f.fluid_production_statistics.output_counts[k] then + cons = f.fluid_production_statistics.output_counts[k] + end + if f.kill_count_statistics.output_counts[k] then + lost = f.kill_count_statistics.output_counts[k] + end + log("\t"..k.."\t"..prod.."\t"..(-cons).."\t"..(-lost).."\t"..(prod-cons-lost)) + end + for k, cons in pairs(f.fluid_production_statistics.output_counts) do + local prod = 0 + local lost = 0 + if f.kill_count_statistics.output_counts[k] then + lost = f.kill_count_statistics.output_counts[k] + end + if not f.fluid_production_statistics.input_counts[k] then + log("\t"..k.."\t"..prod.."\t"..(-cons).."\t"..(-lost).."\t"..(prod-cons-lost)) + end + end end end) diff --git a/info.json b/info.json index c282e1c..dfb382e 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "some-benchmark", - "version": "0.17.2", + "version": "0.17.3", "title": "Someone's production benchmark logger", "author": "someone1337", "homepage": "https://git.somenet.org/pub/jan/factorio_some-benchmark.git", -- 2.43.0