Private
Public Access
1
0

Initial Commit

This commit is contained in:
Jan Grießhaber
2025-12-28 18:48:24 +01:00
commit 149b085cb7
13 changed files with 296 additions and 0 deletions

18
pollution-stats.lua Normal file
View File

@@ -0,0 +1,18 @@
function GetPollutionStats()
for _,surface in pairs(game.surfaces) do
local surface_name = surface.name
local pollutionParts = {}
local pollution_stats = game.surfaces[surface_name].pollution_statistics
local pollution_input = pollution_stats.input_counts
local pollution_output = pollution_stats.output_counts
pollutionParts[#pollutionParts+1] = ("---pollution-input---%s\n"):format(surface_name)
for name, stat in pairs(pollution_input) do
pollutionParts[#pollutionParts+1] = ("%s:%d"):format(name, stat)
end
pollutionParts[#pollutionParts+1] = ("---pollution-output---%s\n"):format(surface_name)
for name, stat in pairs(pollution_output) do
pollutionParts[#pollutionParts+1] = ("%s:%d"):format(name, stat)
end
helpers.send_udp(52555, table.concat(pollutionParts,"\n"),1)
end
end