Private
Public Access
1
0
Files
lua-prometheus-exporter/logistic-network-stats.lua
Jan Grießhaber d803bce9d3 Fixed options
2026-01-02 00:50:58 +01:00

25 lines
849 B
Lua

function GetAllLogisticGrids()
local resultParts = {}
resultParts[#resultParts+1] = "---logistic-grids---\n"
for _,surface in pairs(game.surfaces) do
local grids = game.forces["player"].logistic_networks[surface.name]
for _,grid in pairs(grids) do
resultParts[#resultParts+1] = ("%s:%d:%d:%d:%d:%d:%d"):format(
surface.name,
grid.network_id,
grid.all_construction_robots,
grid.all_logistic_robots,
grid.available_construction_robots,
grid.available_logistic_robots,
grid.robot_limit)
end
end
return table.concat(resultParts, "\n")
end
function SendLogisticStats()
if options.enableRobots then
helpers.send_udp(udpAddress,GetAllLogisticGrids(),serverIndex)
end
end