mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
working on multi player reports
This commit is contained in:
1 parent
53cd6c846a
commit
6466e12504
1 file changed
+6
-1
@@ -23,6 +23,10 @@ end
|
||||
game.print(o)
|
||||
|
||||
/c
|
||||
|
||||
local o = ""
|
||||
|
||||
for a,b in pairs(game.players) do
|
||||
local inventory = game.players["Danielv123"].get_inventory(defines.inventory.player_main).get_contents()
|
||||
local quickbar = game.players["Danielv123"].get_quickbar().get_contents()
|
||||
--[[ Get contents of requester slots into a table ]]
|
||||
@@ -31,8 +35,8 @@ for i = 1, game.players["Danielv123"].force.character_logistic_slot_count do
|
||||
requests[i] = game.players["Danielv123"].character.get_request_slot(i)
|
||||
end
|
||||
|
||||
o = o.."{inventory:{"
|
||||
--[[ generate JS table (not JSON) ]]
|
||||
local o = "{inventory:{"
|
||||
for k,v in pairs(inventory) do
|
||||
o = o.."['"..k.."']:"..v..","
|
||||
end
|
||||
@@ -45,6 +49,7 @@ for k,v in pairs(requests) do
|
||||
o = o.."['"..v["name"].."']:"..v["count"]..", "
|
||||
end
|
||||
o = o.."}}"
|
||||
end
|
||||
game.print(o)
|
||||
game.write_file("test.txt", o)
|
||||
|
||||
|
||||
Reference in new issue
Block a user