Guides › Bots

Bot tactics

What it does

The Bot tactics package lets you give each bot of your party an ordered list of rules, like the gambits of Final Fantasy XII: "ally below 50% health: Flash Heal", "current target casting: Kick". The bot runs the first rule that fits and is possible right now; whatever your rules do not cover is left to its normal class AI. It needs the Playerbots package.

It also brings the in-game Party window: orders for the whole group, your roster, the bots' bags, gear, talents, spells, loot rules and quests, all with buttons instead of chat commands.

Open the party window

The launcher copies the Party (Bot Tactics) addon into the game when you start it. In the game:

  • type /bt or /tactics,
  • or click the round button under your player frame (drag it to move it),
  • or bind a key: Key Bindings, section Party, "Open / close the party window".

/bt button hides or shows the round button, /bt reset puts the windows back in their default place.

Invite your bots first: the window manages the bots of yours that are in your group.

The window

On the left is the roster: In group lists the bots in your party, My bots the other characters of your account. Their buttons Log in and Invite bring an altbot into the game and into the group. Right-click a bot for To me (summon), Trade, Remove from group and Log out.

Along the top runs the orders strip. To: chooses who gets the orders (everyone, tanks, healers, damage, melee or ranged), then:

Button What it does
Attack Attack your target.
Follow me Follow you.
Stay Stay here.
Fall back Run back to you without fighting.
Passive Bots do not attack on their own (always all bots).
Group Formation, default raid mark, reviving the fallen, drinking, a loot rule for every bot, and actions for all bots: maintenance, sell grey, call favourites, log in, roll for an item, spread out, grind mode, log out.
Pull How the group starts a fight: how many seconds to wait so the tank gets the enemies first, one target or spread over the pack, and "Tank: pull my target". Presets: Single target, Pack, Careful, Reset.

Below are the tabs of the selected bot: Tactics, Bags & trade, Loot & quests, Gear, Talents, Spellbook and Style.

Rules (the Tactics tab)

Each rule is one row: target, condition and action.

  1. Select a bot on the left and open Tactics.
  2. Choose In combat or Out of combat: each has its own list.
  3. Click + Add rule, pick the target, the condition and the action. + condition adds a second condition; both must be true.
  4. Drag rows or use the arrows to order them. The higher row wins.

Changes are saved on the server a second after you make them; Revert drops unsaved changes. The Tactics on checkbox switches the rules of this bot off, so it plays only its class AI.

The list always starts with "Dungeon & boss mechanics - always first" and ends with "Class AI - always last": your rules can never override boss mechanics, and the class AI acts when no rule fits. If a rule's action is impossible at the moment (out of range, on cooldown, no mana), the next row is checked. A rule that fires glows blue, and with "Show fired rules over party frames" its name appears over the party frame.

A list has 11 rule slots. Up to 5 presets per bot (+ preset) keep different rule sets; click one to make it active, double-click to rename it.

Targets, conditions and actions

Targets: your side Targets: enemies
Bot itself Current target
Ally Your target
Tank Tank's target
Healer Nearest foe
You (leader) Attacking me
Attacking healer
Skull mark, Moon mark
Boss or elite

Conditions check the rule's target (health, mana, effects, class, creature type, casting, distance, enemies nearby, fight length, moving, melee range, pet health) or the situation (tank's health, healer's mana, my health, my mana, my resource, an ability being ready, my stance or form, enemies in the fight). "Casting spell..." takes any spell id, so you can react to one specific enemy cast.

Actions are the bot's own spells, items from its bags (potions, elixirs, food and bandages, oils and poisons; a bot only uses what it carries), or special actions:

Special action What it does
Switch target Switch to the target; the class AI or your rules do the hitting.
Melee attack, Shoot Auto-attack or auto-shoot the target. Put these below your abilities.
Stop attacking Stop attacking and clear the target.
Move to target, Move away Walk up to the target, or step about 12 yards away towards the group.
Stand behind tank Move behind the tank and stay there.
Follow leader Drop everything and run to you.
Hold position Stop moving.
Wait Do nothing: blocks the rules below while the condition is true.
Cancel own aura Remove one of the bot's own effects (form, stance, buff).
Pet: attack, follow, stay Orders to the bot's pet.
Drink, Eat Out of combat only.

Examples

Bot Target Condition Action
Priest Ally HP below 50% Flash Heal
Priest Tank missing aura: Power Word: Shield Power Word: Shield
Rogue Current target casting (interruptible) Kick
Mage Bot itself enemies nearby at least 3 Arcane Explosion
Any Bot itself HP below 30% a healing potion

Rules are stored per bot and per leader: when you invite the bot again, it has your rules back.

Spellbook: orders and per-spell rules

The Spellbook tab lists the bot's spells. Pick a spell and:

  • Cast now: one cast with top priority on the target you choose (you, your target, the tank's target...). It never overrides dungeon mechanics and expires after 12 seconds.
  • How to use in combat: "As the class AI decides", "Only on:" a target, or "Never use". This steers the class AI itself, without writing a rule.
  • + Tactics rule with this spell starts a new rule.

Style: role, behaviour and AI initiative

The Style tab sets what the class AI does:

  • Role: tank, healer or damage. Switches the bot's whole combat strategy set.
  • In combat and Out of combat switches: area attacks, save mana, stay behind the target, avoid AoE, whose target to attack, focus one target, watch threat, group buffs, pick up loot, gather herbs and ore, eat and drink, plus class options (blessings, auras, aspects, curses, totems, armor, demon...).
  • Pet: stance and orders for the bot's pet.
  • AI initiative: how much the bot does on its own on top of your rules.
Position What the bot adds by itself
Strict Nothing: only your rules and the class AI.
Safety net Saves itself, interrupts and dispels when no rule did it.
Partner (default) Also heals by priority, picks the right target, keeps its position and uses cooldowns.
Own judgement Reacts faster, watches earlier and switches area attacks by itself.

Manual mode ("Only my rules") turns the class AI's choices off: the bot only does what your rules say. Mechanics, following, looting, eating and mounting stay automatic; potions and racials too, unless you also tick "Potions and racials too". The AI log on the Tactics tab shows the last actions of the class AI, your rules and the AI layer.

Bags, gear, talents and quests

Tab What you can do
Bags & trade Use, equip, sell, destroy or move the bot's items, "Give to me" into an open trade window, bank when a banker is near, sell grey at a vendor, buy and buy back.
Gear The bot's paperdoll and stats; change items per slot, save and wear outfits, run autogear. Reputation and skills are in the sidebar.
Talents Spend points, switch specs, learn the second spec, apply a premade build, set glyphs, learn from the trainer next to the bot.
Loot & quests Loot mode and always-loot list, the bot's quests (drop, accept all from an NPC, completed quests).

Like an RPG

Like an RPG (in the Loot & quests tab) makes the bots follow what you do:

Option What happens
Take quests with you When you accept a quest, your bots take it too.
Turn in quests with you When you turn one in, they do too; "Even without done objectives" lets them turn it in anyway.
Abandon quests with you When you abandon a quest, they do too.
Flights after you Bots near the flight master fly with you; the others join you when you land.
Hearthstone and portals after you After your hearthstone, a portal or a waystone the bots join you.
Sell junk and repair at vendors Bots near the vendor you talk to sell grey items and repair.
Learn at the trainer Bots near the trainer you visit learn what their trainer teaches.
Talk to the NPCs you talk to Bots near you also talk to the NPC (off by default).
Say it in party chat Bots mention what they took, turned in or could not do.

Reward chooses the quest reward a bot takes: the best for the bot, or the same as yours. Each option can be turned off for single bots.

Settings

In the launcher: Settings, group Tactics (applied after a server restart).

Setting What it does
Tactics enabled Turns the whole package on or off.
Priority over the class AI How strongly rules outrank the class AI (default 95; the class AI tops out at 93). Boss mechanics always win.
LuaJIT compiler Faster scripts, but the safety limit on script work becomes approximate.
AI log entries per bot How many recent decisions the AI log keeps (0 turns it off).
Log every decision Writes every decision to the server log. Very noisy.

Mirroring ("Like an RPG") can be switched off for the whole server with Tactics.Mirror.Enable = 0, and Tactics.Mirror.Radius (default 30 yards) sets how close bots must be to join vendor and trainer visits. Both are in configs/modules/mod_lonelyice_tactics.conf.

Scripting in Lua

Everything the rules do is written in Lua: the targets, conditions, actions, the AI layer and the party window's server side. The scripts are in the plugin's folder, plugins/lonelyice.tactics/lua/tactics; the Tactics.ScriptDir config key can point to your own copy instead. lua/tactics/README.md describes the files and the wow API.

For example, a new condition is an entry in catalog.lua and a function in conditions.lua:

-- catalog.lua, in catalog.conditions
{ id = "moving", param = "none", lvl = 0,
  label = { en = "moving", ru = "движется" }, prefix = { en = "moving", ru = "движется" } },

-- conditions.lua
conditions.moving = {
    check = function(env, u, v) return u:isMoving() end,
}

After editing, reload the scripts without a restart, in the launcher console or in the game with a GM account (see Accounts and GM):

.tactics reload
.tactics status

reload prints "ok, version N" or the load error; status shows the script folder, the version and the error counters. If a script fails to load, the rules stay off and the bots play with their class AI until the next successful reload. The editor picks up new conditions, targets and actions by itself the next time the window opens.