From a0781c2b86e51fd3f7f64aa5c36206d79da4f966 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Wed, 26 Aug 2026 09:27:45 +0200 Subject: [PATCH] Expose ClassicAPI auto-attack helpers --- api.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/api.lua b/api.lua index 71df716..78cc918 100644 --- a/api.lua +++ b/api.lua @@ -31,6 +31,12 @@ API.aurapositional = type(_G.C_UnitAuras) == "table" API.spellinfo = type(_G.GetSpellInfo) == "function" API.actioninfo = type(_G.GetActionInfo) == "function" +API.autoattack = type(_G.C_Spell) == "table" + and type(_G.C_Spell.IsAutoAttackSpell) == "function" + and type(_G.C_Spell.IsRangedAutoAttackSpell) == "function" +API.autoattackbook = type(_G.C_SpellBook) == "table" + and type(_G.C_SpellBook.IsAutoAttackSpellBookItem) == "function" + and type(_G.C_SpellBook.IsRangedAutoAttackSpellBookItem) == "function" API.inventory = type(_G.C_Container) == "table" and type(_G.C_Container.GetContainerNumFreeSlots) == "function" @@ -147,6 +153,24 @@ API.GetActionInfo = function(slot) end end +API.IsAutoAttackSpell = function(spellID) + return API.autoattack and _G.C_Spell.IsAutoAttackSpell(spellID) or false +end + +API.IsRangedAutoAttackSpell = function(spellID) + return API.autoattack and _G.C_Spell.IsRangedAutoAttackSpell(spellID) or false +end + +API.IsAutoAttackSpellBookItem = function(slot, bookType) + return API.autoattackbook + and _G.C_SpellBook.IsAutoAttackSpellBookItem(slot, bookType) or false +end + +API.IsRangedAutoAttackSpellBookItem = function(slot, bookType) + return API.autoattackbook + and _G.C_SpellBook.IsRangedAutoAttackSpellBookItem(slot, bookType) or false +end + API.GetAuraDataByIndex = function(unit, index, filter) if API.auras then return _G.C_UnitAuras.GetAuraDataByIndex(unit, index, filter)