Skip to content

Aggressive bots

Bots declare war more often, hit back harder, make fewer mistakes and raid twice as often.

main.luau
-- every personality, base or added by a mod that loaded first
for _, id in mod.data.list("bots") do
local b = mod.data.get("bots", id)
mod.data.patch("bots", id, {
war = math.min(10, b.war * 3),
retaliate = math.min(10, b.retaliate * 2),
mistake = b.mistake / 2,
})
end
-- and the timing every bot shares
local t = mod.data.get("bot_tuning", "main")
mod.data.patch("bot_tuning", "main", {
raid_gap = t.raid_gap / 2,
war_odds = t.war_odds * 3,
max_wars = 4,
})
  • mod.data.list("bots") includes personalities other mods added, as long as they loaded first. Add "load_after": ["their_id"] to your mod.json to be sure.
  • war and retaliate are 0 to 10, per personality; math.min keeps them in range. A value outside a field’s range is an error, not clamped.
  • mistake is a chance, 0 to 1. Halving it can only go down.
  • bot_tuning is one record, main, shared by every bot.

Fields: bots, bot tuning.