script.on_event(defines.events.on_tick, function(event) if event.tick % 7200 == 0 then local f = game.forces["player"] log("\n\ntick:"..game.tick.."\titem\tproduced\tconsumed\tlost\tdiff") for k, prod in pairs(f.item_production_statistics.input_counts) do local cons = 0 local lost = 0 if f.item_production_statistics.output_counts[k] then cons = f.item_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.item_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.item_production_statistics.input_counts[k] then 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)