From ff73210d2d59c438ada5660edd82a4ebc24bc6bf Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Mon, 9 Mar 2026 15:37:51 -0400 Subject: [PATCH] some debug --- Conditionals.lua | 45 +++++++++++++++++++++++++++++++++++++++++++++ Core.lua | 8 ++++++++ README.md | 2 +- 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/Conditionals.lua b/Conditionals.lua index a0093b4..8293344 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -3572,6 +3572,25 @@ function CleveRoids.ValidateAura(unit, args, isbuff) if isPlayer then local buffIndex = gufSlot - 1 stacks = GetPlayerBuffApplications(buffIndex) + -- Hidden auras can shift visible buff positions, causing + -- gufSlot-1 to not match the GetPlayerBuff index. When + -- stacks look wrong, scan GetPlayerBuff to find the + -- correct buff ID by spell ID and get accurate stacks. + if (not stacks or stacks <= 1) and gufSpellId and _G.GetPlayerAuraDuration then + for si = 0, 31 do + local sbid = GetPlayerBuff(si, "HELPFUL") + if sbid < 0 then break end + local sid = _G.GetPlayerAuraDuration(sbid) + if sid and sid == gufSpellId then + local verified = GetPlayerBuffApplications(sbid) + if verified and verified > (stacks or 0) then + stacks = verified + buffIndex = sbid + end + break + end + end + end if not stacks or stacks == 0 then stacks = gufStacks or 0 end @@ -3602,6 +3621,24 @@ function CleveRoids.ValidateAura(unit, args, isbuff) if isPlayer then local buffIndex = gufSlot - 1 stacks = GetPlayerBuffApplications(buffIndex) + -- Hidden auras can shift visible buff positions (see buff path above) + if (not stacks or stacks <= 1) and gufSpellId and _G.GetPlayerAuraDuration then + local debuffFilter = gufSlot > 32 and "HARMFUL" or "HELPFUL" + local maxSlot = gufSlot > 32 and 47 or 31 + for si = 0, maxSlot do + local sbid = GetPlayerBuff(si, debuffFilter) + if sbid < 0 then break end + local sid = _G.GetPlayerAuraDuration(sbid) + if sid and sid == gufSpellId then + local verified = GetPlayerBuffApplications(sbid) + if verified and verified > (stacks or 0) then + stacks = verified + buffIndex = sbid + end + break + end + end + end if not stacks or stacks == 0 then stacks = gufStacks or 0 end @@ -3930,6 +3967,14 @@ function CleveRoids.ValidateAura(unit, args, isbuff) elseif isPlayer and not args.checkStacks and args.amount and ops[args.operator] then return cmp[args.operator](remaining or -1, args.amount) elseif args.amount and args.checkStacks and ops[args.operator] then + if CleveRoids.debug then + DEFAULT_CHAT_FRAME:AddMessage(string.format( + "|cffff9900[StackCheck]|r %s: found=%s, stacks=%s, %s %s = %s", + tostring(args.name), tostring(found), tostring(stacks), + args.operator, tostring(args.amount), + cmp[args.operator](stacks or -1, args.amount) and "|cff00ff00PASS|r" or "|cffff0000FAIL|r" + )) + end return cmp[args.operator](stacks or -1, args.amount) elseif not isPlayer and not args.checkStacks and args.amount and ops[args.operator] then -- Non-player aura time comparison: use tracked time or treat as 0 if found/-1 if missing diff --git a/Core.lua b/Core.lua index caa4614..243c189 100644 --- a/Core.lua +++ b/Core.lua @@ -2085,6 +2085,14 @@ function CleveRoids.ParseMsg(msg) -- accept decimals too; capture name/op/amount local _, _, name, operator, amount = string.find(arg_for_find, "([^>~=<]*)([>~=<]+)(#?%d*%.?%d+)") + if CleveRoids.debug then + DEFAULT_CHAT_FRAME:AddMessage(string.format( + "|cffff9900[Parse]|r cond=%s arg='%s' find='%s' name=%s op=%s amt=%s", + tostring(condition), tostring(processed_arg), tostring(arg_for_find), + tostring(name), tostring(operator), tostring(amount) + )) + end + if not operator or not amount then -- No operator found, treat as simple string argument table.insert(conditionals[condition], processed_arg) diff --git a/README.md b/README.md index 551e07f..6043f13 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Enhanced macro addon for World of Warcraft 1.12.1 (Vanilla/Turtle WoW) with dyna | Mod | Required | Purpose | |-----|:--------:|---------| | [Nampower](https://gitea.com/avitasia/nampower/releases) (v3.0.0+) | ✅ | Spell queueing, DBC data, auto-attack events | -| [UnitXP_SP3](https://codeberg.org/konaka/UnitXP_SP3/releases) | ❌ | Distance checks, `[multiscan]` enemy scanning | +| [UnitXP_SP3](https://codeberg.org/konaka/UnitXP_SP3/releases) | ✅ | Distance checks, `[multiscan]` enemy scanning | ## Installation