From 17f28dcdfd9117a98c966272208a5818d3765a31 Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Fri, 6 Mar 2026 19:43:36 -0500 Subject: [PATCH] feature mouseuse and attempt to fix stopattack --- Console.lua | 11 ++++++++++- Core.lua | 25 ++++++++++++++++++++++++- Init.lua | 1 + 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/Console.lua b/Console.lua index 3df5607..bccb3b1 100644 --- a/Console.lua +++ b/Console.lua @@ -111,7 +111,16 @@ local StartAttack = function(msg) end local StopAttack = function(msg) - if CleveRoids.CurrentSpell.autoAttack and UnitExists("target") then + local isAttacking = CleveRoids.CurrentSpell.autoAttack + if not isAttacking then + -- Fallback: check action bar state via IsCurrentAction + -- (PLAYER_ENTER_COMBAT event may not have fired yet in same frame) + local slot = CleveRoids.GetProxyActionSlot(CleveRoids.Localized.Attack) + if slot and IsCurrentAction(slot) then + isAttacking = true + end + end + if isAttacking and UnitExists("target") then AttackTarget() CleveRoids.CurrentSpell.autoAttack = false end diff --git a/Core.lua b/Core.lua index 686f2e7..2ad31a8 100644 --- a/Core.lua +++ b/Core.lua @@ -2554,6 +2554,22 @@ function CleveRoids.DoWithConditionals(msg, hook, fixEmptyTargetFunc, targetBefo end end + -- [mouseuse] modifier: auto-click the AOE targeting circle at cursor position + if conditionals.mouseuse and SpellIsTargeting() then + local wasAttacking = CleveRoids.CurrentSpell.autoAttack + CameraOrSelectOrMoveStart() + CameraOrSelectOrMoveStop() + -- CameraOrSelectOrMoveStart can start auto-attack as a side effect. + -- Stop it immediately if it wasn't active before. + if not wasAttacking then + local slot = CleveRoids.GetProxyActionSlot(CleveRoids.Localized.Attack) + if slot and CleveRoids.Hooks.IsCurrentAction(slot) then + AttackTarget() + CleveRoids.CurrentSpell.autoAttack = false + end + end + end + if needRetarget then TargetLastTarget() end @@ -2930,7 +2946,14 @@ end -- PERFORMANCE: Module-level actions to avoid closure allocation per call local function _stopAttackAction() - if CleveRoids.CurrentSpell.autoAttack and UnitExists("target") then + local isAttacking = CleveRoids.CurrentSpell.autoAttack + if not isAttacking then + local slot = CleveRoids.GetProxyActionSlot(CleveRoids.Localized.Attack) + if slot and CleveRoids.Hooks.IsCurrentAction(slot) then + isAttacking = true + end + end + if isAttacking and UnitExists("target") then AttackTarget() CleveRoids.CurrentSpell.autoAttack = false end diff --git a/Init.lua b/Init.lua index 5a1ec0e..b789c47 100644 --- a/Init.lua +++ b/Init.lua @@ -170,6 +170,7 @@ CleveRoids.ignoreKeywords = { _operators = true, -- Metadata for AND/OR operator tracking _groups = true, -- Grouped conditional values for AND/OR evaluation multiscan = true, -- Processed before Keywords loop (target resolution) + mouseuse = true, -- Post-cast modifier: auto-click AOE targeting circle at cursor } -- TODO: Localize?