mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
fix(graftorio): config issues
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
modules = {
|
modules = {
|
||||||
["forcestats"]=true,
|
["forcestats"] = true,
|
||||||
["general"]=true,
|
["logistorage"] = false,
|
||||||
|
["general"] = true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
local Event = require("utils.event")
|
local Event = require("utils.event")
|
||||||
local general = require("modules.graftorio.general")
|
local general = require("modules.graftorio.general")
|
||||||
|
local config = require("config.graftorio")
|
||||||
|
|
||||||
local lib = {}
|
local lib = {}
|
||||||
|
|
||||||
@@ -114,7 +115,7 @@ lib.collect_loginet = function()
|
|||||||
stats.to_charge_robot_count = (stats.to_charge_robot_count) + cell.to_charge_robot_count
|
stats.to_charge_robot_count = (stats.to_charge_robot_count) + cell.to_charge_robot_count
|
||||||
end
|
end
|
||||||
|
|
||||||
if settings.general.data["graftorio-logistic-items"].value then
|
if config.modules.logistorage then
|
||||||
for name, v in pairs(network.get_contents()) do
|
for name, v in pairs(network.get_contents()) do
|
||||||
stats.items[name] = (stats.items[name] or 0) + v
|
stats.items[name] = (stats.items[name] or 0) + v
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
local Commands = require("expcore.commands")
|
local Commands = require("expcore.commands")
|
||||||
local config = require("config.graftorio")
|
local config = require("config.graftorio")
|
||||||
|
|
||||||
local general = require("modules.graftorio.general")
|
|
||||||
local statics = require("modules.graftorio.statics")
|
local statics = require("modules.graftorio.statics")
|
||||||
local forcestats = {}
|
local forcestats = nil
|
||||||
|
local general = nil
|
||||||
if config.modules.forcestats then
|
if config.modules.forcestats then
|
||||||
forcestats = require("modules.graftorio.forcestats")
|
forcestats = require("modules.graftorio.forcestats")
|
||||||
end
|
end
|
||||||
|
if config.modules.general then
|
||||||
|
general = require("modules.graftorio.general")
|
||||||
|
end
|
||||||
|
|
||||||
Commands.new_command("collectdata", "Collect data for RCON usage")
|
Commands.new_command("collectdata", "Collect data for RCON usage")
|
||||||
:add_param("location", true)
|
:add_param("location", true)
|
||||||
@@ -14,9 +16,10 @@ Commands.new_command("collectdata", "Collect data for RCON usage")
|
|||||||
-- this must be first as it overwrites the stats
|
-- this must be first as it overwrites the stats
|
||||||
-- also makes the .other table for all forces
|
-- also makes the .other table for all forces
|
||||||
statics.collect_statics()
|
statics.collect_statics()
|
||||||
general.collect_other()
|
if config.modules.general then general.collect_other() end
|
||||||
if config.modules.forcestats then
|
if config.modules.forcestats then
|
||||||
forcestats.collect_production()
|
forcestats.collect_production()
|
||||||
|
forcestats.collect_loginet()
|
||||||
end
|
end
|
||||||
rcon.print(game.table_to_json(general.data.output))
|
rcon.print(game.table_to_json(general.data.output))
|
||||||
return Commands.success()
|
return Commands.success()
|
||||||
|
|||||||
Reference in New Issue
Block a user