#Hello I would like some help fixing lua errors on a WA

10 messages · Page 1 of 1 (latest)

turbid fiber
#

Hello, not very good at this stuff, so I took 2 weakauras and turned them into a weakaura that I wanted for tracking priest buffs and ranks, and need some help cleaning up lua errors.
https://wago.io/LECa5cCvl

Wago.io is a database of sharable World of Warcraft addon elements

fathom echo
#

you basically just need to change it from
spellId = aura_env.state.spellId
to
local spellId = aura_env.state.spellId
same for rank

#

reason for the error is if you don't do that then spellId becomes a global value, where all of your other weakauras check it too. can cause problems sometimes

turbid fiber
#

thank you ill take a look after ❤️

turbid fiber
#

Is it cool if I post a bugstack error I'm getting with the weakaura? I changed the rank and spell ID to local, I believe correctly?

fathom echo
#

yes post any bugsack errors you get, and also link the updated aura if you can

turbid fiber
#

function()
local spellId = aura_env.state.spellId
if spellId == nil then return end
local rank = string.match(GetSpellSubtext(spellId), "%d+")
return rank
end

fathom echo
#

switch to:

function()
    local spellId = aura_env.state.spellId
    if spellId then
        local rank = GetSpellSubtext(spellId)
        if rank then
            return rank:match("%d+")
        end
    end
end

error happens because GetSpellSubtext sometimes doesn't give anything when spell data isn't loaded yet