Posted Weakaura Custom Trigger not working, take a look at it?

*Reply:
I looked into the suggested resources. I did not completely understand what I’ve read so far. However I’m still confused how this trigger should look for the changes that came with battle for Azertoth. I appreciate your suggestions, you have been helpful.

Custom Trigger:

function()

local PtWTarget = (UnitGUID("target") or "")
if  not (PtWTarget == "") and 
(PtWTarget == (aura_env.PtWTarget or "")) and
UnitCanAttack("player", "target") and 
not UnitIsDead("target") and
not (UnitDebuff("target", "Purge the Wicked", "PLAYER")) then
    aura_env.PtWTarget = PtWTarget
    return true 
else
    aura_env.PtWTarget = PtWTarget
    return false
end

end


Custom Untrigger:

function()

return true

end

I’m pretty sure the problem is with UnitDebuff. The 2nd argument can’t be a name, it has to be an index #. I think that was something Blizz recently changed.

Check out FindAuraByName
https://wow.gamepedia.com/API_AuraUtil.FindAuraByName

1 Like

FYI as daunting as it sounds to spin through all (possibly) 40 auras looking for one in particular, I did exhaustive testing of this in my own addon with a midrange Ryzen processor (1600) and never took longer than 3/10th of a microsecond to pull all the auras from myself, my pet, my focus, my target, and my target’s target.

It’s crazy fast.

Just spin through the auras for the unit you care about and pull the one (or ones) with the name (or names) you care about.

Although I just noticed you’re using WA and I can’t vouch for that addon’s efficiency. It’s lack thereof is why I HAVE my own addon for this.

1 Like