Uncommon Rares
Macro APITriggers

Combat Action Requested

Chooses the player's next combat action.

Category
Combat
Runs when
The player needs to act.
Summary
Chooses the player's next combat action.
Version
1

Events

  • system-combat-action-requested

Lua Example

if ctx.combat.self.hasLifeConsumable and ctx.combat.self.lifeRatio < 0.3 then
  print("Low life", ctx.combat.self.lifeRatio)
  return combat.drinkPotion()
end

if ctx.combat.self.firstReadyNonBasicAbilityKey ~= nil then
  return combat.useAbility(ctx.combat.self.firstReadyNonBasicAbilityKey, "lowestLife")
end

return combat.attack("lowestLife")

ctx Fields

TriggerPathTypeLabelDescription
Combat Action Requestedctx.combat.roundNumbernumberRound numberCurrent combat round number.
Combat Action Requestedctx.combat.enemyCountnumberEnemy countNumber of active enemies.
Combat Action Requestedctx.combat.self.lifeRationumberSelf life ratioCurrent life divided by maximum life.
Combat Action Requestedctx.combat.self.manaRationumberSelf mana ratioCurrent mana divided by maximum mana.
Combat Action Requestedctx.combat.self.hasLifeConsumablebooleanSelf has life consumableWhether a life-restoring consumable is available.
Combat Action Requestedctx.combat.self.statusesarraySelf statusesStatus keys currently active on the player.
Combat Action Requestedctx.combat.self.guardReadybooleanGuard readyWhether Guard is currently ready and affordable.
Combat Action Requestedctx.combat.self.firstReadyNonBasicAbilityKeystringFirst ready non-basic abilityThe first ready non-basic ability key, or null when none is ready.
Combat Action Requestedctx.combat.abilitiesarrayAbilitiesAbility readiness records with key, cooldown, and affordability.
Combat Action Requestedctx.combat.ability.rend.readybooleanRend readyWhether Rend is currently ready and affordable.
Combat Action Requestedctx.combat.enemiesarrayEnemiesActive enemies with index, life band, tier, statuses, and intent.
Combat Action Requestedctx.combat.enemies[].intentobjectEnemy intentCurrent enemy intent, or null when no action is being prepared. Intent records include kind, damageType, and magnitudeBand.
Combat Action Requestedctx.combat.any.enemyIntentHeavybooleanAny heavy intentWhether any enemy is preparing a heavy action.
Combat Action Requestedctx.combat.any.enemyCastingbooleanAny enemy castingWhether any enemy is preparing a cast.
Combat Action Requestedctx.combat.any.enemyLowbooleanAny enemy lowWhether any enemy is in the low life band.
Combat Action Requestedctx.player.levelnumberPlayer levelThe player level used for this macro run.
Combat Action Requestedctx.player.currencyCoppernumberCurrencyThe player currency carried in copper.
Combat Action Requestedctx.player.bag.usedSlotsnumberBag usedThe number of backpack slots currently occupied.
Combat Action Requestedctx.player.bag.maxSlotsnumberBag capacityThe current backpack capacity including equipped bag bonuses.
Combat Action Requestedctx.player.bag.freeSlotsnumberBag freeThe number of free backpack slots remaining.
Combat Action Requestedctx.player.derivedStats.maxLifenumberDerived statA derived stat value; other stat keys are available beside maxLife.
Combat Action Requestedctx.player.equipment.mainHand.itemDefinitionKeystringEquipped itemAn equipped item definition key. Replace mainHand with another equipment slot as needed.
Combat Action Requestedctx.player.equipment.mainHand.raritystringEquipped item rarityThe rarity of an equipped item.
Combat Action Requestedctx.player.equipment.mainHand.itemLevelnumberEquipped item levelThe required level of an equipped item.
Combat Action Requestedctx.player.equipment.mainHand.dropLevelnumberEquipped drop levelThe drop level used to generate an equipped item.
Combat Action Requestedctx.player.equipment.mainHand.stats.maxLifenumberEquipped item statA stat contribution from an equipped item; other stat keys are available beside maxLife.
Combat Action Requestedctx.player.equipment.mainHand.affixes[].keystringEquipped affixA rolled affix key on an equipped item.

Blocks

BlockCategorySummary
Use Potion ThresholdCombatChecks whether a potion should be used at the default life threshold.
Retreat Below LifeCombatChecks whether the player is below the default retreat threshold.
If Ability ReadyCombatChecks whether a combat ability is ready and affordable.
If Enemy LowCombatChecks whether any active enemy is in the low life band.
If Heavy IntentCombatChecks whether any active enemy has heavy intent.
If Self StatusCombatChecks the first status currently active on the player.
AttackCombatReturns attack to the active Combat Profile.
Focus Casting EnemyCombatReturns an attack decision targeting a casting enemy.
Use AbilityCombatReturns a specific ability decision to combat.
GuardCombatReturns Guard as the selected combat ability.
Drink PotionCombatReturns drink potion to the active Combat Profile.
RetreatCombatReturns retreat to combat.
PauseFlowReturns pause to the Storyteller.