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
| Trigger | Path | Type | Label | Description |
|---|---|---|---|---|
| Combat Action Requested | ctx.combat.roundNumber | number | Round number | Current combat round number. |
| Combat Action Requested | ctx.combat.enemyCount | number | Enemy count | Number of active enemies. |
| Combat Action Requested | ctx.combat.self.lifeRatio | number | Self life ratio | Current life divided by maximum life. |
| Combat Action Requested | ctx.combat.self.manaRatio | number | Self mana ratio | Current mana divided by maximum mana. |
| Combat Action Requested | ctx.combat.self.hasLifeConsumable | boolean | Self has life consumable | Whether a life-restoring consumable is available. |
| Combat Action Requested | ctx.combat.self.statuses | array | Self statuses | Status keys currently active on the player. |
| Combat Action Requested | ctx.combat.self.guardReady | boolean | Guard ready | Whether Guard is currently ready and affordable. |
| Combat Action Requested | ctx.combat.self.firstReadyNonBasicAbilityKey | string | First ready non-basic ability | The first ready non-basic ability key, or null when none is ready. |
| Combat Action Requested | ctx.combat.abilities | array | Abilities | Ability readiness records with key, cooldown, and affordability. |
| Combat Action Requested | ctx.combat.ability.rend.ready | boolean | Rend ready | Whether Rend is currently ready and affordable. |
| Combat Action Requested | ctx.combat.enemies | array | Enemies | Active enemies with index, life band, tier, statuses, and intent. |
| Combat Action Requested | ctx.combat.enemies[].intent | object | Enemy intent | Current enemy intent, or null when no action is being prepared. Intent records include kind, damageType, and magnitudeBand. |
| Combat Action Requested | ctx.combat.any.enemyIntentHeavy | boolean | Any heavy intent | Whether any enemy is preparing a heavy action. |
| Combat Action Requested | ctx.combat.any.enemyCasting | boolean | Any enemy casting | Whether any enemy is preparing a cast. |
| Combat Action Requested | ctx.combat.any.enemyLow | boolean | Any enemy low | Whether any enemy is in the low life band. |
| Combat Action Requested | ctx.player.level | number | Player level | The player level used for this macro run. |
| Combat Action Requested | ctx.player.currencyCopper | number | Currency | The player currency carried in copper. |
| Combat Action Requested | ctx.player.bag.usedSlots | number | Bag used | The number of backpack slots currently occupied. |
| Combat Action Requested | ctx.player.bag.maxSlots | number | Bag capacity | The current backpack capacity including equipped bag bonuses. |
| Combat Action Requested | ctx.player.bag.freeSlots | number | Bag free | The number of free backpack slots remaining. |
| Combat Action Requested | ctx.player.derivedStats.maxLife | number | Derived stat | A derived stat value; other stat keys are available beside maxLife. |
| Combat Action Requested | ctx.player.equipment.mainHand.itemDefinitionKey | string | Equipped item | An equipped item definition key. Replace mainHand with another equipment slot as needed. |
| Combat Action Requested | ctx.player.equipment.mainHand.rarity | string | Equipped item rarity | The rarity of an equipped item. |
| Combat Action Requested | ctx.player.equipment.mainHand.itemLevel | number | Equipped item level | The required level of an equipped item. |
| Combat Action Requested | ctx.player.equipment.mainHand.dropLevel | number | Equipped drop level | The drop level used to generate an equipped item. |
| Combat Action Requested | ctx.player.equipment.mainHand.stats.maxLife | number | Equipped item stat | A stat contribution from an equipped item; other stat keys are available beside maxLife. |
| Combat Action Requested | ctx.player.equipment.mainHand.affixes[].key | string | Equipped affix | A rolled affix key on an equipped item. |
Blocks
| Block | Category | Summary |
|---|---|---|
| Use Potion Threshold | Combat | Checks whether a potion should be used at the default life threshold. |
| Retreat Below Life | Combat | Checks whether the player is below the default retreat threshold. |
| If Ability Ready | Combat | Checks whether a combat ability is ready and affordable. |
| If Enemy Low | Combat | Checks whether any active enemy is in the low life band. |
| If Heavy Intent | Combat | Checks whether any active enemy has heavy intent. |
| If Self Status | Combat | Checks the first status currently active on the player. |
| Attack | Combat | Returns attack to the active Combat Profile. |
| Focus Casting Enemy | Combat | Returns an attack decision targeting a casting enemy. |
| Use Ability | Combat | Returns a specific ability decision to combat. |
| Guard | Combat | Returns Guard as the selected combat ability. |
| Drink Potion | Combat | Returns drink potion to the active Combat Profile. |
| Retreat | Combat | Returns retreat to combat. |
| Pause | Flow | Returns pause to the Storyteller. |