Files
factorio-scenario-ExpCluster/exp_scenario/module/commands/bot_queue.lua
2024-11-19 22:36:52 +00:00

29 lines
1.2 KiB
Lua

--[[-- Commands - Bot queue
Adds a command that allows viewing and changing the construction queue limits
]]
local Commands = require("modules/exp_commands")
--- Get / Set the current values for the bot queue
Commands.new("bot-queue", { "exp-commands_bot-queue.description" })
:optional("amount", { "exp-commands_bot-queue.arg-amount" }, Commands.types.integer_range(1, 20))
:add_flags{ "admin_only" }
:register(function(player, amount)
if amount then
player.force.max_successful_attempts_per_tick_per_construction_queue = 3 * amount
player.force.max_failed_attempts_per_tick_per_construction_queue = 5 * amount
game.print{
"exp-commands_bot-queue.set",
player.force.max_successful_attempts_per_tick_per_construction_queue,
player.force.max_failed_attempts_per_tick_per_construction_queue,
}
return Commands.status.success()
end
return Commands.status.success{
"exp-commands_bot-queue.get",
player.force.max_successful_attempts_per_tick_per_construction_queue,
player.force.max_failed_attempts_per_tick_per_construction_queue,
}
end)