#Updating Old WA Custom Triggers (WeakAuras.region deprecated )

3 messages · Page 1 of 1 (latest)

cedar bolt
#

I found a set of weak auras for a custom UI that I like. Unfortunately they are a few years old and seem to have some deprecated code. It looks to be specifically for the Duration info under the spell triggers, for example, this is what's under the "Execute: Fury" aura:

function()
local this = WeakAuras.regions[aura_env.id].region
local thisSpell = GetSpellInfo(280735)
local s,d = GetSpellCooldown(thisSpell)
local isexec,isexec2 = IsUsableSpell(thisSpell)
local _,gcd = GetSpellCooldown(61304)

if (IsSpellInRange(thisSpell,"target") == 1) then
    if (d ~= 0 and d > gcd) or (not isexec) or (isexec2) then
        this.icon:SetVertexColor(0.42,0.3,0.75,1)
        this.icon:SetDesaturated(true)
        this:SetGlow(false)
    else
        this.icon:SetVertexColor(1,1,1,1,1)
        this.icon:SetDesaturated(false)
        this:SetGlow(true)
    end 
else 
    this.icon:SetVertexColor(0.65,0.22,0.30,1)
    this.icon:SetDesaturated(true)
    this:SetGlow(false)
end

return d, s + d

end

I assume this is an issue with line 2. Is there a way to correct this code without drastically changing the functionality? If I could get assistance with this one, I think I'd be able to adjust the rest.

(link to the WA page https://wago.io/r1Wy_uogz/25)

Thanks!

HUD/Rotation for Fury Warrior Requires Level 100+. Unexpected errors may occur at lower levels. If you'd like to

odd jasper
#

If you want to remove all the deprecated parts then it would look like this

function()
    local thisSpell = GetSpellInfo(280735)
    local s,d = GetSpellCooldown(thisSpell)
    return d, s + d
end

Then you use conditions to set the color changes that the old code was doing.

winged juniper
#

You should get rid of even that and just use a simple default trigger.