mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
29 lines
1.2 KiB
Lua
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)
|