C++ Game Bot Spell Sequencing Implementation Help

Working on an MMORPG automation project and need help with ability rotation logic

I’m building a game bot in C++ and having trouble with the spell casting sequence algorithm. The main challenge is executing character abilities in the optimal order based on their cooldowns and cast times.

Here’s what I’m working with:

struct Ability {
    string abilityName;
    int cooldownTime;  // milliseconds
    int castingTime;   // milliseconds
    bool isReady;
};

// Example character setup
Ability playerAbilities[3] = {
    {"FireBolt", 800, 400, true},
    {"IceSpear", 1200, 600, true}, 
    {"Lightning", 1800, 750, true}
};

The bot needs to determine which ability to use next based on availability and timing. Right now I can randomly pick available spells, but I want to create a proper rotation system that maximizes efficiency.

The number of abilities varies per character (anywhere from 2 to 10 skills). I need an algorithm that considers both cooldown timers and casting durations to build an optimal sequence.

Any suggestions for implementing this kind of priority system? I’m interested in this as a programming challenge rather than actual gameplay.

a priority queue could work well! just check cooldowns and cast times, use the one that’s ready the quickest. this will help u maintain a steady flow in ur rotation without complicating it too much.