Migrate all commands to new lib

This commit is contained in:
Cooldude2606
2024-11-08 12:59:46 +00:00
parent c9bf85835f
commit 4b6872c14c
103 changed files with 2415 additions and 3694 deletions

View File

@@ -0,0 +1,28 @@
--[[-- 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)