### Enable/Disable Rotation System - MaxDps API Source: https://context7.com/kaminaris/maxdps/llms.txt Functions to manually enable or disable the MaxDps rotation helper system. Enabling initializes class modules and starts the spell recommendation timer. Disabling stops the system. Auto-enabling on combat entry is a configurable option. ```lua -- Enable rotation manually MaxDps:EnableRotation() -- The rotation is auto-enabled on combat enter when configured -- In MaxDps options: onCombatEnter = true -- Disable rotation MaxDps:DisableRotation() ``` -------------------------------- ### Initialize Rotation Modules - MaxDps API Source: https://context7.com/kaminaris/maxdps/llms.txt Initializes rotation modules for the current class and specialization. This function loads custom rotations if defined, otherwise it loads the default class module. It can be triggered manually to reload rotations, for example, after changing talent builds. ```lua -- Initialize rotations for current class/spec MaxDps:InitRotations() -- This is called automatically but can be triggered manually to reload -- For example, after changing talent builds: MaxDps:DisableRotation(true) -- silent disable MaxDps:InitRotations() MaxDps:EnableRotation() ``` -------------------------------- ### MaxDps Custom Events for WeakAuras Source: https://context7.com/kaminaris/maxdps/llms.txt MaxDps fires custom events that can be used as triggers in WeakAuras. These events provide real-time updates on spell recommendations, cooldowns, target counts, and time-to-die estimates. The example shows how to set up a WeakAura to listen for MAXDPS_SPELL_UPDATE and display the recommended spell icon. ```lua -- Events fired by MaxDps: -- MAXDPS_SPELL_UPDATE - When recommended spell changes -- MAXDPS_COOLDOWN_UPDATE - When cooldown flags change -- MAXDPS_TARGET_COUNT - When enemy count changes -- MAXDPS_TIME_TO_DIE - When TTD estimate updates -- WeakAura trigger setup: -- Type: Custom -- Event: MAXDPS_SPELL_UPDATE -- Custom Trigger: function(event, spellId) if spellId then return true end return false end -- Display recommended spell icon in WeakAura: function() local spellId = MaxDps.Spell if spellId and spellId ~= 0 then local info = C_Spell.GetSpellInfo(spellId) return info and info.iconID end end ``` -------------------------------- ### Get Spell Cooldown Information - MaxDps API Source: https://context7.com/kaminaris/maxdps/llms.txt Returns comprehensive cooldown information for a given spell ID, including charge data. This function helps determine if a spell is ready to be cast, its remaining cooldown, and the status of its charges. ```lua -- Get cooldown info for a spell local cd = MaxDps:CooldownConsolidated(spellId, timeShift) -- Returns: { -- duration = base_cooldown_duration, -- ready = true if can be cast, -- remains = seconds until ready, -- fullRecharge = time until all charges restored, -- partialRecharge = time until next charge, -- charges = current_charges, -- maxCharges = maximum_charges -- } -- Example: Check if Execute is ready local executeCd = MaxDps:CooldownConsolidated(163201) if executeCd.ready then return 163201 end -- Check charges for abilities like Fire Blast local fireBlastCd = MaxDps:CooldownConsolidated(108853) if fireBlastCd.charges >= 1 then return 108853 end ``` -------------------------------- ### MaxDps Configuration Options Source: https://context7.com/kaminaris/maxdps/llms.txt This section outlines the configuration options available for the MaxDps addon, accessible via `MaxDps.db.global`. These options control various aspects of the addon's behavior, including enabling features, setting update intervals, customizing visual glows, and managing cooldown displays. ```lua -- Access addon settings local opts = MaxDps.db.global -- Common options: opts.enabled -- Master enable/disable opts.onCombatEnter -- Auto-enable on combat opts.interval -- Update frequency (0.1-2 seconds) opts.enableCooldowns -- Show cooldown glows opts.enableDefensives -- Show defensive glows opts.forceSingle -- Force single target mode opts.disableButtonGlow -- Disable Blizzard proc glows opts.texture -- Overlay texture path opts.highlightColor -- {r, g, b, a} for main highlight opts.cooldownColor -- {r, g, b, a} for cooldowns -- Custom glow settings: opts.customGlow -- Use LibCustomGlow opts.customGlowType -- 'pixel' or 'particle' opts.customGlowLines -- Number of glow lines opts.customGlowFrequency -- Animation speed ``` -------------------------------- ### Create Custom Rotation Logic Source: https://context7.com/kaminaris/maxdps/llms.txt Enables the creation of custom spell rotation logic using Lua. This system allows access to various game data like cooldowns, buffs, debuffs, talents, enemy counts, and estimated time to die, to determine the next spell. ```lua -- Custom rotation function format function() local fd = MaxDps.FrameData local cooldown = fd.cooldown local buff = fd.buff local debuff = fd.debuff local talents = fd.talents local targets = MaxDps:SmartAoe() local timeToDie = fd.timeToDie -- Example: Simple priority rotation -- Check cooldowns first if cooldown[12472].ready then -- Icy Veins MaxDps:GlowCooldown(12472, true) end -- Check for procs if buff[44544].up then -- Fingers of Frost return 30455 -- Ice Lance end -- AoE check if targets >= 3 then if cooldown[84714].ready then -- Frozen Orb return 84714 end return 190356 -- Blizzard end -- Single target filler return 116 -- Frostbolt end ``` -------------------------------- ### Buff and Debuff Tracking Source: https://context7.com/kaminaris/maxdps/llms.txt APIs for tracking active buffs on the player and debuffs on the target. ```APIDOC ## MaxDps.PlayerAuras / MaxDps.TargetAuras ### Description Track active buffs on the player and debuffs on the target. These are metatables that return default values for missing auras. ### Access `MaxDps.PlayerAuras[spellId]` `MaxDps.TargetAuras[spellId]` ### Returns - **name** (string) - The name of the aura. - **up** (boolean) - True if the aura is currently active. - **count** (number) - The stack count of the aura. - **remains** (number) - Seconds remaining until the aura expires. - **duration** (number) - The total duration of the aura. - **refreshable** (boolean) - True if the aura can be refreshed (e.g., remains < 0.3 * duration). ## MaxDps:CollectAuras ### Description Collects all auras for a unit and populates the aura tables. Automatically called during the rotation loop, but can be manually triggered. ### Method `MaxDps:CollectAuras(unit, options)` ### Parameters - **unit** (string) - The unit to collect auras for ('player' or 'target'). - **options** (table) - Optional table, e.g., `{ isFullUpdate = true }`. ``` -------------------------------- ### Glow Cooldown on Ready Source: https://context7.com/kaminaris/maxdps/llms.txt Highlights a cooldown ability on the action bar when a specific condition is met, such as when the cooldown is ready and a buff is active. Custom colors can be applied by passing an additional color table argument. ```lua -- Glow a cooldown when it should be used local cdReady = MaxDps:CooldownConsolidated(12472).ready -- Icy Veins local hasBuff = MaxDps.PlayerAuras[190319].up -- Combustion MaxDps:GlowCooldown(12472, cdReady and hasBuff) -- The glow will show with the cooldown color (green by default) -- Pass a custom color as third parameter: MaxDps:GlowCooldown(spellId, condition, { r = 1, g = 0.5, b = 0, a = 1 }) ``` -------------------------------- ### Core API Functions Source: https://context7.com/kaminaris/maxdps/llms.txt Functions to control and manage the MaxDps rotation system. ```APIDOC ## MaxDps:EnableRotation ### Description Enables the rotation helper system, initializing class modules and starting the spell recommendation timer. This is typically called automatically when entering combat (if configured) or manually via the `/maxdps` command. ### Method `MaxDps:EnableRotation()` ### Description Disables the rotation helper system. ### Method `MaxDps:DisableRotation()` ## MaxDps:InitRotations ### Description Initializes rotation modules for the current class and specialization. Loads custom rotations if defined, otherwise loads the default class module. This is called automatically but can be triggered manually to reload, for example, after changing talent builds. ### Method `MaxDps:InitRotations()` ## MaxDps:InvokeNextSpell ### Description The main rotation loop function that evaluates the current game state and determines the next recommended spell. Called automatically on a timer (default 0.15 seconds). It prepares frame data, updates aura data, glows consumables, and then calls the class-specific `NextSpell` function. ### Method `MaxDps:InvokeNextSpell()` ``` -------------------------------- ### Custom Rotation System Source: https://context7.com/kaminaris/maxdps/llms.txt Allows users to create and integrate custom rotation logic in Lua within the MaxDps framework. This includes defining rotation functions and managing custom rotations. ```APIDOC ## Custom Rotation System ### Description Write custom rotation logic in Lua that integrates with the MaxDps framework. This section covers creating custom rotation functions and using the Custom Rotation API to manage them. ### Creating Custom Rotations Custom rotation logic is written in Lua and should follow a specific function format. The `MaxDps.FrameData` table provides access to relevant combat information. ```lua -- Custom rotation function format function() local fd = MaxDps.FrameData local cooldown = fd.cooldown local buff = fd.buff local debuff = fd.debuff local talents = fd.talents local targets = MaxDps:SmartAoe() local timeToDie = fd.timeToDie -- Example: Simple priority rotation -- Check cooldowns first if cooldown[12472].ready then -- Icy Veins MaxDps:GlowCooldown(12472, true) end -- Check for procs if buff[44544].up then -- Fingers of Frost return 30455 -- Ice Lance end -- AoE check if targets >= 3 then if cooldown[84714].ready then -- Frozen Orb return 84714 end return 190356 -- Blizzard end -- Single target filler return 116 -- Frostbolt end ``` ### Custom Rotation API The `Custom` module within MaxDps provides functions to create, load, and retrieve custom rotations. ```lua -- Access the custom rotation module local Custom = MaxDps:GetModule('Custom') -- Create a new rotation local rotation = Custom:CreateCustomRotation() rotation.name = "My Custom Rotation" rotation.class = 8 -- Mage rotation.spec = 3 -- Frost rotation.enabled = true rotation.fn = [[ function() local fd = MaxDps.FrameData -- rotation logic here return spellId end ]] -- Load custom rotations Custom:LoadCustomRotations() -- Get rotation for class/spec local customRot = Custom:GetCustomRotation(classId, specId) if customRot then MaxDps.NextSpell = customRot.fn end ``` ### Response #### Success Response (200) - **Success** (boolean) - Indicates if the operation was successful. - **rotationDetails** (table) - Details of the created or retrieved rotation. #### Response Example ```json { "Success": true, "rotationDetails": { "name": "My Custom Rotation", "class": 8, "spec": 3, "enabled": true } } ``` ``` -------------------------------- ### Check Player Talents Source: https://context7.com/kaminaris/maxdps/llms.txt Scans and queries the player's current talent configuration. Talents are automatically scanned on spec change. Direct table access or a helper function can be used to check for specific talents or their ranks. ```lua -- Talents are automatically scanned on spec change -- Access via MaxDps.PlayerTalents or use helper function -- Check if player has a specific talent if MaxDps:HasTalent(391109) then -- Some talent spell ID -- Use talent-specific rotation end -- Direct table access also works local talentRank = MaxDps.PlayerTalents[391109] if talentRank and talentRank > 0 then -- Talent is active end -- For Retail, hero talents are tracked separately local heroTree = MaxDps.ActiveHeroTree -- e.g., "slayer", "templar" ``` -------------------------------- ### Low-Level Action Bar Glow Control Source: https://context7.com/kaminaris/maxdps/llms.txt Provides low-level control over the action bar glow effects, allowing for custom overlay appearances. You can apply glows with specific IDs, textures, and types (normal or cooldown), and also hide them. ```lua -- Apply glow to a button MaxDps:Glow(button, 'myGlowId', texture, 'normal', color) -- Hide specific glow MaxDps:HideGlow(button, 'myGlowId') -- Glow types: 'normal' (highlight color), 'cooldown' (green color) -- Custom glow options: pixel glow, particle glow (configured in settings) ``` -------------------------------- ### Invoke Next Spell Recommendation - MaxDps API Source: https://context7.com/kaminaris/maxdps/llms.txt The core rotation loop function that evaluates the current game state and determines the next recommended spell. This function is called automatically on a timer and prepares frame data, updates aura data, and glows the recommended spell. ```lua -- The rotation system calls this internally -- It prepares frame data and invokes the NextSpell function function MaxDps:InvokeNextSpell() self:PrepareFrameData() self:UpdateAuraData() self:GlowConsumables() -- NextSpell is defined by class modules local ok, res = xpcall(self.NextSpell, err, self) if ok then self.Spell = res end -- Glow the recommended spell if self.Spell and self.Spell ~= 0 then self:GlowNextSpell(self.Spell) end end ``` -------------------------------- ### Estimate Time to Target Death (Classic Only) Source: https://context7.com/kaminaris/maxdps/llms.txt Estimates the time until a target will die using linear regression on health samples. This function is only available in Classic versions of the game. It can also estimate the time to reach a specific health percentage. ```lua -- Get estimated time to die local ttd = MaxDps:GetTimeToDie() if ttd < 20 then -- Use execute phase abilities return 163201 -- Execute end -- Get time to reach a specific health percentage local timeTo20 = MaxDps:GetTimeToPct(20) if timeTo20 < 5 then -- Prepare for execute phase end ``` -------------------------------- ### MaxDps Utility Functions for Spell and Item Management Source: https://context7.com/kaminaris/maxdps/llms.txt MaxDps provides several utility functions to assist with gameplay logic, such as checking spell usability, retrieving spell costs, verifying equipped items, monitoring trinket readiness, and checking previous spell casts. These functions help in creating more dynamic and responsive rotation helpers. ```lua -- Check if spell is usable if MaxDps:CheckSpellUsable(spellId, "SpellName") then return spellId end -- Get spell power cost local cost = MaxDps:GetSpellCost(spellId, "Rage") -- Check equipped items if MaxDps:CheckEquipped("Trinket Name") then -- Use trinket-specific logic end -- Check trinket cooldowns local trinket1Ready = MaxDps:CheckTrinketReady(1) local trinket2Ready = MaxDps:CheckTrinketReady(2) -- Check previous spell cast if MaxDps:CheckPrevSpell(spellId) then -- Don't cast same spell twice end -- Target health percentage local healthPct = MaxDps:TargetPercentHealth() if healthPct < 0.2 then return executeSpellId end -- Check for Bloodlust/Heroism if MaxDps:Bloodlust() then -- Use cooldowns during lust end ``` -------------------------------- ### MaxDps:Glow / MaxDps:HideGlow Source: https://context7.com/kaminaris/maxdps/llms.txt Provides low-level control for custom overlay effects on action bar buttons. `Glow` applies a glow with specified parameters, and `HideGlow` removes a specific glow. ```APIDOC ## POST /MaxDps:Glow ## POST /MaxDps:HideGlow ### Description Low-level glow control for custom overlay effects. `Glow` applies a glow to a button with specified parameters, and `HideGlow` removes a specific glow. ### Method POST ### Endpoint /MaxDps:Glow /MaxDps:HideGlow ### Parameters #### Path Parameters - **button** (string) - Required - The action bar button to apply the glow to. - **glowId** (string) - Required - A unique identifier for the glow. - **texture** (string) - Required (for Glow) - The texture path for the glow. - **glowType** (string) - Optional - The type of glow ('normal', 'cooldown'). Defaults to 'normal'. - **color** (table) - Optional - A table with r, g, b, a values for custom glow color. ### Request Example ```lua -- Apply glow to a button MaxDps:Glow(button, 'myGlowId', texture, 'normal', color) -- Hide specific glow MaxDps:HideGlow(button, 'myGlowId') -- Glow types: 'normal' (highlight color), 'cooldown' (green color) -- Custom glow options: pixel glow, particle glow (configured in settings) ``` ### Response #### Success Response (200) - **Success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "Success": true } ``` ``` -------------------------------- ### Manage Custom Rotations via API Source: https://context7.com/kaminaris/maxdps/llms.txt Provides an API to create, load, and retrieve custom spell rotations. You can define rotation properties like name, class, spec, and the Lua function logic. Custom rotations can then be loaded and applied to the MaxDps rotation system. ```lua -- Access the custom rotation module local Custom = MaxDps:GetModule('Custom') -- Create a new rotation local rotation = Custom:CreateCustomRotation() rotation.name = "My Custom Rotation" rotation.class = 8 -- Mage rotation.spec = 3 -- Frost rotation.enabled = true rotation.fn = "\nfunction()\n local fd = MaxDps.FrameData\n -- rotation logic here\n return spellId\nend\n" -- Load custom rotations Custom:LoadCustomRotations() -- Get rotation for class/spec local customRot = Custom:GetCustomRotation(classId, specId) if customRot then MaxDps.NextSpell = customRot.fn end ``` -------------------------------- ### Count Enemies in Range (Smart AoE) Source: https://context7.com/kaminaris/maxdps/llms.txt Returns the number of enemies currently in combat range, intelligently accounting for melee and ranged enemy detection. This is useful for making AoE targeting decisions in rotations. ```lua -- Get enemy count for AoE decisions local targets = MaxDps:SmartAoe() if targets >= 3 then return aoeSpellId else return singleTargetSpellId end -- Force single target mode via options -- MaxDps.db.global.forceSingle = true ``` -------------------------------- ### MaxDps:GlowCooldown Source: https://context7.com/kaminaris/maxdps/llms.txt Highlights a cooldown ability on the action bar when a specific condition is met. It can also accept a custom color for the glow. ```APIDOC ## POST /MaxDps:GlowCooldown ### Description Highlights a cooldown ability on the action bar when a condition is met. You can optionally provide a custom color. ### Method POST ### Endpoint /MaxDps:GlowCooldown ### Parameters #### Query Parameters - **spellId** (number) - Required - The ID of the spell to glow. - **condition** (boolean) - Required - A boolean indicating whether the condition for glowing is met. - **color** (table) - Optional - A table with r, g, b, a values for custom glow color. ### Request Example ```lua -- Glow a cooldown when it should be used local cdReady = MaxDps:CooldownConsolidated(12472).ready -- Icy Veins local hasBuff = MaxDps.PlayerAuras[190319].up -- Combustion MaxDps:GlowCooldown(12472, cdReady and hasBuff) -- The glow will show with the cooldown color (green by default) -- Pass a custom color as third parameter: MaxDps:GlowCooldown(spellId, condition, { r = 1, g = 0.5, b = 0, a = 1 }) ``` ### Response #### Success Response (200) - **Success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "Success": true } ``` ``` -------------------------------- ### MaxDps:GlowNextSpell / MaxDps:GlowClear Source: https://context7.com/kaminaris/maxdps/llms.txt Controls the visual overlay system for highlighting recommended spells on the action bar. GlowNextSpell highlights a spell, clearing previous highlights, while GlowClear removes all highlights. ```APIDOC ## POST /MaxDps:GlowNextSpell ## POST /MaxDps:GlowClear ### Description Controls the visual overlay system for highlighting recommended spells. `GlowNextSpell` highlights a spell and clears previous highlights, while `GlowClear` removes all highlights. ### Method POST ### Endpoint /MaxDps:GlowNextSpell /MaxDps:GlowClear ### Parameters #### Path Parameters - **spellId** (number) - Required (for GlowNextSpell) - The ID of the spell to highlight. ### Request Example ```lua -- Highlight a spell (clears previous highlight first) MaxDps:GlowNextSpell(spellId) -- Clear all highlights MaxDps:GlowClear() -- Highlight without clearing (for multiple simultaneous glows) MaxDps:GlowSpell(spellId) ``` ### Response #### Success Response (200) - **Success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "Success": true } ``` ``` -------------------------------- ### Cooldown Management Source: https://context7.com/kaminaris/maxdps/llms.txt Functions for retrieving and managing spell cooldown information. ```APIDOC ## MaxDps:CooldownConsolidated ### Description Returns comprehensive cooldown information for a spell, including charge data. ### Method `MaxDps:CooldownConsolidated(spellId, timeShift)` ### Parameters - **spellId** (number) - The ID of the spell. - **timeShift** (number, optional) - A time offset in seconds to check cooldowns relative to a future or past time. ### Returns - **duration** (number) - The base cooldown duration of the spell. - **ready** (boolean) - True if the spell can currently be cast. - **remains** (number) - Seconds remaining until the spell is ready. - **fullRecharge** (number) - Time in seconds until all charges are restored. - **partialRecharge** (number) - Time in seconds until the next charge is restored. - **charges** (number) - The current number of available charges. - **maxCharges** (number) - The maximum number of charges for the spell. ``` -------------------------------- ### Count Enemies with Threat Source: https://context7.com/kaminaris/maxdps/llms.txt Counts the number of enemies the player currently has threat with, which is particularly useful for tank rotations. It can also return a list of these units for further inspection, such as checking for debuffs. ```lua local count, units = MaxDps:ThreatCounter() print("Currently tanking " .. count .. " enemies") -- Iterate over threat units for _, unit in ipairs(units) do local debuff = MaxDps:TargetAura(772, 0) -- Check Rend if not debuff.up then -- Need to apply Rend to this target end end ``` -------------------------------- ### Control Action Bar Spell Glow Source: https://context7.com/kaminaris/maxdps/llms.txt Manages the visual overlay system for highlighting recommended spells on the action bar. Spells can be highlighted individually or cleared. This system helps players identify the next optimal spell to cast. ```lua -- Highlight a spell (clears previous highlight first) MaxDps:GlowNextSpell(spellId) -- Clear all highlights MaxDps:GlowClear() -- Highlight without clearing (for multiple simultaneous glows) MaxDps:GlowSpell(spellId) ``` -------------------------------- ### Player and Target Aura Tracking - MaxDps API Source: https://context7.com/kaminaris/maxdps/llms.txt Access active buffs on the player and debuffs on the target. These are metatables that provide detailed information about each aura, including its presence, duration, and stack count. They return default values for missing auras. ```lua -- Access buff data on player local buff = MaxDps.PlayerAuras[spellId] -- Returns: { -- name = "Buff Name", -- up = true/false, -- count = stack_count, -- remains = seconds_remaining, -- duration = total_duration, -- refreshable = true if remains < 0.3 * duration -- } -- Example: Check if player has Bloodlust local bloodlust = MaxDps.PlayerAuras[2825] if bloodlust.up then print("Bloodlust active, " .. bloodlust.remains .. " seconds remaining") end -- Check debuff on target local debuff = MaxDps.TargetAuras[772] -- Rend if debuff.refreshable then return 772 -- Recommend refreshing Rend end ``` -------------------------------- ### MaxDps:CheckTalents / MaxDps:HasTalent Source: https://context7.com/kaminaris/maxdps/llms.txt Scans and queries the player's current talent configuration. Talents are automatically scanned on spec change and can be accessed directly or via helper functions. ```APIDOC ## GET /MaxDps:CheckTalents ## GET /MaxDps:HasTalent ### Description Scans and queries the player's current talent configuration. Talents are automatically scanned on spec change and can be accessed directly or via helper functions. Hero talents are tracked separately in Retail. ### Method GET ### Endpoint /MaxDps:CheckTalents /MaxDps:HasTalent ### Parameters #### Query Parameters - **talentId** (number) - Required (for HasTalent) - The ID of the talent to check. ### Request Example ```lua -- Talents are automatically scanned on spec change -- Access via MaxDps.PlayerTalents or use helper function -- Check if player has a specific talent if MaxDps:HasTalent(391109) then -- Some talent spell ID -- Use talent-specific rotation end -- Direct table access also works local talentRank = MaxDps.PlayerTalents[391109] if talentRank and talentRank > 0 then -- Talent is active end -- For Retail, hero talents are tracked separately local heroTree = MaxDps.ActiveHeroTree -- e.g., "slayer", "templar" ``` ### Response #### Success Response (200) - **talentRank** (number) - The rank of the talent (0 if not present). - **heroTree** (string) - The active hero talent tree name. #### Response Example ```json { "talentRank": 1, "heroTree": "slayer" } ``` ``` -------------------------------- ### Collect Aura Data - MaxDps API Source: https://context7.com/kaminaris/maxdps/llms.txt Collects all auras for a unit (player or target) and populates the respective aura tables. This function is automatically called during the rotation loop but can also be triggered manually to refresh aura data. ```lua -- Auras are collected automatically, but can be manually triggered MaxDps:CollectAuras("player", { isFullUpdate = true }) MaxDps:CollectAuras("target", { isFullUpdate = true }) -- Access the collected data for spellId, auraData in pairs(MaxDps.PlayerAuras) do print(auraData.name, auraData.count, auraData.remains) end ``` -------------------------------- ### MaxDps:SmartAoe Source: https://context7.com/kaminaris/maxdps/llms.txt Returns the number of enemies in combat range, accounting for melee and ranged detection. This is useful for making AoE decisions in rotations. ```APIDOC ## GET /MaxDps:SmartAoe ### Description Returns the number of enemies in combat range, accounting for melee/ranged detection. This is useful for determining when to use AoE abilities. ### Method GET ### Endpoint /MaxDps:SmartAoe ### Parameters None ### Request Example ```lua -- Get enemy count for AoE decisions local targets = MaxDps:SmartAoe() if targets >= 3 then return aoeSpellId else return singleTargetSpellId end -- Force single target mode via options -- MaxDps.db.global.forceSingle = true ``` ### Response #### Success Response (200) - **targetCount** (number) - The number of enemies detected in combat range. #### Response Example ```json { "targetCount": 5 } ``` ``` -------------------------------- ### MaxDps:ThreatCounter Source: https://context7.com/kaminaris/maxdps/llms.txt Counts enemies the player has threat with, which is particularly useful for tank rotations. It also returns a list of units the player has threat on. ```APIDOC ## GET /MaxDps:ThreatCounter ### Description Counts enemies the player has threat with, useful for tank rotations. It also returns a list of units the player has threat on. ### Method GET ### Endpoint /MaxDps:ThreatCounter ### Parameters None ### Request Example ```lua local count, units = MaxDps:ThreatCounter() print("Currently tanking " .. count .. " enemies") -- Iterate over threat units for _, unit in ipairs(units) do local debuff = MaxDps:TargetAura(772, 0) -- Check Rend if not debuff.up then -- Need to apply Rend to this target end end ``` ### Response #### Success Response (200) - **threatCount** (number) - The number of enemies the player has threat with. - **threatUnits** (array) - A list of unit IDs the player has threat on. #### Response Example ```json { "threatCount": 3, "threatUnits": ["unit1", "unit2", "unit3"] } ``` ``` -------------------------------- ### MaxDps:GetTimeToDie / MaxDps:GetTimeToPct Source: https://context7.com/kaminaris/maxdps/llms.txt Estimates the time until a target dies or reaches a specific health percentage using linear regression on health samples. This functionality is available in Classic versions only. ```APIDOC ## GET /MaxDps:GetTimeToDie ## GET /MaxDps:GetTimeToPct ### Description Estimates time until target dies or reaches a specific health percentage using linear regression on health samples. Available in Classic versions only. ### Method GET ### Endpoint /MaxDps:GetTimeToDie /MaxDps:GetTimeToPct ### Parameters #### Query Parameters - **percentage** (number) - Required (for GetTimeToPct) - The target health percentage (e.g., 20 for 20%). ### Request Example ```lua -- Get estimated time to die local ttd = MaxDps:GetTimeToDie() if ttd < 20 then -- Use execute phase abilities return 163201 -- Execute end -- Get time to reach a specific health percentage local timeTo20 = MaxDps:GetTimeToPct(20) if timeTo20 < 5 then -- Prepare for execute phase end ``` ### Response #### Success Response (200) - **estimatedTime** (number) - The estimated time in seconds. #### Response Example ```json { "estimatedTime": 15.5 } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.