2 script.on_event(defines.events.on_tick, function(event)
3 if event.tick % 7200 == 0 then
4 local f = game.forces["player"]
5 log("\n\ntick:"..game.tick.."\titem\tproduced\tconsumed\tlost\tdiff")
6 for k, prod in pairs(f.item_production_statistics.input_counts) do
9 if f.item_production_statistics.output_counts[k] then
10 cons = f.item_production_statistics.output_counts[k]
12 if f.kill_count_statistics.output_counts[k] then
13 lost = f.kill_count_statistics.output_counts[k]
15 log("\t"..k.."\t"..prod.."\t"..(-cons).."\t"..(-lost).."\t"..(prod-cons-lost))
17 for k, cons in pairs(f.item_production_statistics.output_counts) do
20 if f.kill_count_statistics.output_counts[k] then
21 lost = f.kill_count_statistics.output_counts[k]
23 if not f.item_production_statistics.input_counts[k] then
24 log("\t"..k.."\t"..prod.."\t"..(-cons).."\t"..(-lost).."\t"..(prod-cons-lost))
28 for k, prod in pairs(f.fluid_production_statistics.input_counts) do
31 if f.fluid_production_statistics.output_counts[k] then
32 cons = f.fluid_production_statistics.output_counts[k]
34 if f.kill_count_statistics.output_counts[k] then
35 lost = f.kill_count_statistics.output_counts[k]
37 log("\t"..k.."\t"..prod.."\t"..(-cons).."\t"..(-lost).."\t"..(prod-cons-lost))
39 for k, cons in pairs(f.fluid_production_statistics.output_counts) do
42 if f.kill_count_statistics.output_counts[k] then
43 lost = f.kill_count_statistics.output_counts[k]
45 if not f.fluid_production_statistics.input_counts[k] then
46 log("\t"..k.."\t"..prod.."\t"..(-cons).."\t"..(-lost).."\t"..(prod-cons-lost))