WeakAuras

WeakAuras

206M Downloads

Not Working after Update

tomatok4 opened this issue · 8 comments

commented

Description

Last Version Working
current version Not Working

WeakAuras Version

Version: 5.0.1

World of Warcraft Flavor

Wrath of the Lich King Classic

Tested with only WeakAuras

  • Yes
  • No

Lua Error

22x Lua error in aura 'Tracker': 활성 조건 1
WeakAuras 버전: 5.0.1
Aura Version: 1.0.2
[string "return function() local aura_env = aura_env..."]:37: attempt to index upvalue 'db' (a nil value)
[string "return function() local aura_env = aura_env

local spells = {
[54020] = {label = "Eternal Might", icon = 136170},
[56003] = {label = "Spellweave", icon = 237026},
[56002] = {label = "Ebonweave", icon = 237022},
[56001] = {label = "Moonshroud", icon = 237025},
[55208] = {label = "Titansteel", icon = 237046},
[61288] = {label = "Minor Insc", icon = 237171},
[61177] = {label = "North Insc", icon = 237171},
[60893] = {label = "North Alchemy", icon = 136240},
[62242] = {label = "Icy Prism", icon = 134095}
};
local thisToon = UnitName("player");
local thisRealm = GetRealmName();
local db;

local updateFrequency = 1;
local timePast = 0;

if WeakAurasSaved.cooldownsDb then
db = WeakAurasSaved.cooldownsDb;
else
WeakAurasSaved.cooldownsDb = WeakAurasSaved.cooldownsDb or {};
db = WeakAurasSaved.cooldownsDb;
end

-- Functions Start

aura_env.TriggerCooldowns = function(allStates)
if timePast and GetTime() <= timePast then
return;
end
timePast = GetTime() + updateFrequency;

local realm = db[thisRealm] or {characters = {}};
local character = realm.characters[thisToon] or {cooldowns = {}};
CooldownsUpdate(realm, character);
SetDisplayData(allStates);

return true;

end

function CooldownsUpdate(realm, character)
for spellId, _ in pairs(spells) do
UpdateSpellData(spellId, character);
end
realm.characters[thisToon] = character;
db[thisRealm] = realm;
end

function UpdateSpellData(spellId, character)
local spellData = character.cooldowns[spellId] or {}

if IsPlayerSpell(spellId) or (spellId == 15846 and GetItemCount(15846, true) > 0) then
    local start, duration
    if spellId == 15846 then
        start, duration = GetItemCooldown(spellId)
    else
        start, duration = GetSpellCooldown(spellId)
    end
    
    local now = GetTime()
    start = start or 0
    duration = duration or 0
    -- fix huge values
    if duration > 604800 then
        start = 0
        duration = 0
    end
    if start > now + 2147483.648 then
        start = start - 4294967.296
    end
    -- ignore GCD
    if WeakAuras.gcdDuration() ~= 0 then return end
    
    local dt = now - start
    local serverStart = GetServerTime() - dt
    local serverExpiration = serverStart + duration
    
    spellData = {
        start = start,
        duration = duration,
        expiration = serverExpiration,
        gcdDuration = WeakAuras.gcdDuration(),
        now = GetTime(),
        serverTime = GetServerTime(),
    }
else
    spellData = nil
end

character.cooldowns[spellId] = spellData

end

function SetDisplayData(allStates)
for characterName, character in pairs(db[thisRealm].characters) do
for spellId, spellData in pairs(character.cooldowns) do
local spellInfo = spells[spellId]
if spellInfo then
local localExpiration = spellData.expiration - GetServerTime() + GetTime()
local name = characterName .. " - " .. spellInfo.label;
local ready = localExpiration <= GetTime()
local remainingTime = math.max(0, localExpiration - GetTime())
allStates[name] = {
characterName = characterName,
spellId = spellId,
changed = true,
show = true,
name = spellInfo.label,
icon = spellInfo.icon,
duration = spellData.duration,
expirationTime = localExpiration,
value = remainingTime,
total = spellInfo.maxDuration,
ready = ready,
isLabel = false
}
else
character.cooldowns[spellId] = nil
end
end
end
end

aura_env.GetDuration = function()
local expiration = aura_env.state.expirationTime
if expiration ~= 0 and expiration > GetTime() then
local seconds = math.floor(expiration - GetTime())
local days = math.floor(seconds/86400)
local hours = 0;
local minutes = 0;
if (days > 0) then
hours = math.floor((seconds/86400 - days) * 24)
else
hours = math.floor((seconds/86400 - days) * 24)
minutes = math.floor((seconds/86400 - days - hours/24) * 24 * 60)
end

    local time = ""
    if days > 0 then
        time = string.format("%dd",days)
    end
    if hours > 0 then
        time = string.format("%s %dh",time,hours)
    end
    if minutes > 0 then
        time = string.format("%s %dm",time,minutes)
    end
    return time
end
return "Ready"

end

--/cast Alchemy
--/run for i=1,GetNumTradeSkills() do if GetTradeSkillInfo(i)=="Transmute: Arcanite" then CloseTradeSkill() DoTradeSkill(i, 1) break end end
end"]:37: in function <[string "return function() local aura_env = aura_env..."]:31>
[string "=(tail call)"]: ?
[string "=[C]"]: in function xpcall' [string "@WeakAuras\GenericTrigger.lua"]:548: in function <WeakAuras\GenericTrigger.lua:537> [string "@WeakAuras\GenericTrigger.lua"]:752: in function ScanEventsInternal'
[string "@WeakAuras\GenericTrigger.lua"]:713: in function `ScanEvents'
[string "@WeakAuras\GenericTrigger.lua"]:1484: in function <WeakAuras\GenericTrigger.lua:1482>

22x Lua error in aura 'Character Names': 활성 조건 1
WeakAuras 버전: 5.0.1
Aura Version: 1.0.2
[string "return function() local aura_env = aura_env..."]:23: attempt to index upvalue 'db' (a nil value)
[string "return function() local aura_env = aura_env

local thisRealm = GetRealmName();
local db;

local updateFrequency = 1;
local timePast = 0;

if WeakAurasSaved.cooldownsDb then
db = WeakAurasSaved.cooldownsDb;
else
WeakAurasSaved.cooldownsDb = WeakAurasSaved.cooldownsDb or {};
db = WeakAurasSaved.cooldownsDb;
end

aura_env.TriggerCharacterNames = function(allStates)
if timePast and GetTime() <= timePast then
return;
end
timePast = GetTime() + updateFrequency;

for characterName, characterData in pairs(db[thisRealm].characters) do
    local count = 0
    for _ in pairs(characterData.cooldowns) do
        count = count + 1;
    end
    if count > 0 then
        allStates[characterName] = {
            characterName = characterName,
            name = characterName,
            show = true,
            changed = true,
            isLabel = true
        }
    end
end


return true

end
end"]:23: in function <[string "return function() local aura_env = aura_env..."]:17>
[string "=(tail call)"]: ?
[string "=[C]"]: in function xpcall' [string "@WeakAuras\GenericTrigger.lua"]:548: in function <WeakAuras\GenericTrigger.lua:537> [string "@WeakAuras\GenericTrigger.lua"]:752: in function ScanEventsInternal'
[string "@WeakAuras\GenericTrigger.lua"]:713: in function `ScanEvents'
[string "@WeakAuras\GenericTrigger.lua"]:1484: in function <WeakAuras\GenericTrigger.lua:1482>

Reproduction Steps

don't work

Last Good Version

WeakAuras 4.1.5

Screenshots

No response

Export String

No response

commented

That's an error in the aura not the addon

commented

Really wish this hadn't just been closed without really looking...

The issue is this error happens after updating. Version 4.1.5 works just fine.

I've looked at the 'changelog' and found no references to AllState or Aura_env being depreciated.

commented

the issue is in the aura. its using the WeakAurasSaved table, which it cant access.

commented

You should ask author of this aura to fix it and/or update the aura

commented

You should ask author of this aura to fix it and/or update the aura

The author hasn't been around since Classic Vanilla. I've just been adding the new Profession CDs because it's fairly simple in terms of layout.

But, like I said, WA 4.1.5 works just fine. But the moment you hit the Dragonflight versions it breaks. I figure something got depreciated (or more precision was added, but I have no clue where or what.

the issue is in the aura. its using the WeakAurasSaved table, which it cant access.

I assume this was changed for the Dragonflight update?

((Like I said, this WA has worked since Classic Vanilla. And only broke after WA updated for Dragonflight, which meant Wrath Classic's WA was updated too.))

commented

The aura was doing something, that was never supported and this has now stopped being possible. And no, that's not going to be changed back.

commented

The aura was doing something, that was never supported and this has now stopped being possible. And no, that's not going to be changed back.

Not asking for it to be reverted. I'm pointing out that the OP wasn't just posting an error they got because the Aura, itself, was faulty. It was the recent update to WeakAura that broke a perfectly fine Aura.

Ideally, the response would have pointed to a changelog detailing that 'these functions' are now different.

Hmm, from what SpatenLa said...I might be able to fix this if it's just the Database that was used is no longer accessible.

commented

The aura was doing something, that was never supported and this has now stopped being possible. And no, that's not going to be changed back.

Not asking for it to be reverted. I'm pointing out that the OP wasn't just posting an error they got because the Aura, itself, was faulty. It was the recent update to WeakAura that broke a perfectly fine Aura.

Ideally, the response would have pointed to a changelog detailing that 'these functions' are now different.

Hmm, from what SpatenLa said...I might be able to fix this if it's just the Database that was used is no longer accessible.

https://github.com/WeakAuras/WeakAuras2/releases/tag/5.0.0