1. #1

    Question [WeakAura] Need help with troubleshooting a Custom Artifact Power Bar

    Hello!

    I've been messing around today with trying to make a small, custom bar to keep track of my artifact power and playing with the new(ish) C_ArtifactUI functions in the API. I managed to create a bar that functions perfectly and properly keeps track of the current artifact power and the artifact power needed to get the next rank, as well as a progress bar that accurately represents the progress between ranks. I even have the numbers properly concatenated for ease of reading. Go figure, the thing I need help with is incredibly basic and simple, and yet I can't seem to figure it out.

    The problem I've been having is trying to figure out how to disable the aura if an artifact is not equipped (like on a low level alt, for example) without either individually listing out the item IDs of each artifact or setting a level 100-110 trigger. In it's current state, the aura spits out errors like there's no tomorrow if an artifact is not equipped. The error it returns is as follows:
    Code:
    [string "return function()..."]:7: bad argument #1 to 'floor' (number expected, got nil)
    [C]: in function 'floor' [string "return function..."]:7: in function <[string "return function()..."]:1>Interface\AddOns\WeakAuras\RegionTypes\Text- Cannot be learned..lua:121: in function 'UpdateCustomText' Interface/Addons/WeakAuras/WeakAuras-2.3.0.0.lua:2992: in function <Interface/AddOns/WeakAuras/WeakAuras.lua:2988>
    (*temporary) = nil (*temporary) = "number expected, got nil"
    Obviously, this is telling me that a variable in the code is not returning a number as expected. This is very obviously because it's looking for a number associated with an artifact weapon that doesn't exist as an equipped item. My thought was that the easiest fix was to just stop the code from running by adding a custom status trigger that returns HasArtifactEquipped(), as that function properly returns true or false if an artifact weapon is equipped or not. However, even with the custom trigger, the aura still seems to load and it still shoots out errors.

    I've gone as far as trying to add if then else statements checking HasArtifactEquipped() in each custom text display and trigger, but nothing I've tried has changed the result. This is extremely frustrating to me because it seems like such a simple thing that I'm probably just overthinking or is going right over my head...

    I'll include the aura import string here in case anyone wants to take a look at it:
    Code:
    dC1bJaGiPOEecWLaQ4tssQrbuofqAvssiVcbQzjv1TKeSljLFHsQggrogPAziQEgrvtdr5AavTnerFdb14acoNKqRdicVtsICpuL9jjH6GislKOYdLuzIaHUOKOnIs8rGOgPKQ6KsrwPu6LarYmbQ0nLuLDIKFkj1qreokqKAPiepf0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HqsfM)2XyzKqrOxKjNtGqIvcTxuPMShHG8rriesiVMXgPixceqiXkH2lGEI6rk5LqOMh4644N77XiIxgBdHGddc18avz6cJ579rO7CqOttZBEvXDAycVmzVaa5qdH3cx3dnHZCif5i0ZOkiXi0(EmONOEKsNKieWCm8bWIQyiuoVmkLs78Ckv1eF8en9JqIvcTxu99nWBiLozOHgc7fP0jJCD0qe
    Edit:
    Forgot to mention, this is very roughly coded and could probably do with some optimization. It's just very basic work-in-progress stuff.
    Last edited by Darsyek; 2017-02-13 at 09:55 AM. Reason: Added note

  2. #2
    Quote Originally Posted by Darsyek View Post
    Hello!

    I've been messing around today with trying to make a small, custom bar to keep track of my artifact power and playing with the new(ish) C_ArtifactUI functions in the API. I managed to create a bar that functions perfectly and properly keeps track of the current artifact power and the artifact power needed to get the next rank, as well as a progress bar that accurately represents the progress between ranks. I even have the numbers properly concatenated for ease of reading. Go figure, the thing I need help with is incredibly basic and simple, and yet I can't seem to figure it out.

    The problem I've been having is trying to figure out how to disable the aura if an artifact is not equipped (like on a low level alt, for example) without either individually listing out the item IDs of each artifact or setting a level 100-110 trigger. In it's current state, the aura spits out errors like there's no tomorrow if an artifact is not equipped. The error it returns is as follows:
    Code:
    [string "return function()..."]:7: bad argument #1 to 'floor' (number expected, got nil)
    [C]: in function 'floor' [string "return function..."]:7: in function <[string "return function()..."]:1>Interface\AddOns\WeakAuras\RegionTypes\Text- Cannot be learned..lua:121: in function 'UpdateCustomText' Interface/Addons/WeakAuras/WeakAuras-2.3.0.0.lua:2992: in function <Interface/AddOns/WeakAuras/WeakAuras.lua:2988>
    (*temporary) = nil (*temporary) = "number expected, got nil"
    Obviously, this is telling me that a variable in the code is not returning a number as expected. This is very obviously because it's looking for a number associated with an artifact weapon that doesn't exist as an equipped item. My thought was that the easiest fix was to just stop the code from running by adding a custom status trigger that returns HasArtifactEquipped(), as that function properly returns true or false if an artifact weapon is equipped or not. However, even with the custom trigger, the aura still seems to load and it still shoots out errors.

    I've gone as far as trying to add if then else statements checking HasArtifactEquipped() in each custom text display and trigger, but nothing I've tried has changed the result. This is extremely frustrating to me because it seems like such a simple thing that I'm probably just overthinking or is going right over my head...

    I'll include the aura import string here in case anyone wants to take a look at it:
    Code:
    dC1bJaGiPOEecWLaQ4tssQrbuofqAvssiVcbQzjv1TKeSljLFHsQggrogPAziQEgrvtdr5AavTnerFdb14acoNKqRdicVtsICpuL9jjH6GislKOYdLuzIaHUOKOnIs8rGOgPKQ6KsrwPu6LarYmbQ0nLuLDIKFkj1qreokqKAPiepf0urLRIsYwbIiFfLumwusjolkPKwlqe1BrGmxjjWDraTxO)kfgSYHPYIrOEmkMmPCzvTzvQptugnk1PPQvljr9AuvMTkUTuz3s8BsgUk54iKA5eEoGPt56i12LQ03rqgVufNhvvRhHK3Jsk18LKGUVKKSFXOoYHqhYHgcbqi51KVMunje2HqneQHCiuZduLPlmMV3hHUZbHIxMxv44)6rOmHI(cHogZ37Zj8YK9I6P0EKQc6si875Yv0EnuoeYF133aVHu6ssie4p3Kq5lgcLRAoUQRh4wjlCi0RHqsjHCobcDfg2kbju(IHq5QMJR66HWcDhNWlt2laqkDeEuonKdHM78fd5qyh9X8ihAOHqAGVbZXbaGeJqH68ihc7OpMh5qdneE17L5oFXqoe2rFmpYHgAi82XyEvb5qyh9X8ihAOHqn)9TNH(y8JCiSJ(yEKdn0qOWX8ihc7OpMh5qdn0qdHmihsPJCi0(EmwoozaiKsvEe6U8iXieWCm8bWYXjdaHuQYJqxHHTsqcLVyiuUQ54QUEie4Yj4JikZzEvbPKqOqzo75(EmesvnvLiKyhdFYek6IwDQJsGCiLosjHuKJusiL8iLesrgsjHgcVvfJLJtgacRMvCGBtuvIqpJQ0GrDucKdP0rkDKICKshPKhP0rkYqkD0qyNs7pnUCgBecC9NdaR7z(gfvVUADKJqIDI6uhLa5qkDKscPihPKqk5rkjKImKshneQ9aoJw4ShjgHaxobFvFFd8gRvKscHhLtd5qinW3O89(cKyeAUZxmKdHD0hZJCOHgczooaaK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Kq5lgPgrCf(a789cA)mtq)zFrlTFrdHm0aMQdH30fgZRkGbAAZYYYeVrlkz13bqQW83ogRsIM2FD9AGbAA)IwAtBAridnGP6Ay8F9ieWCgnaczy)m8Hq6lnN9iKHgWuDny71EeA(UxdneAFpgsmcj2XWNmHIUOvN6OeihsrgYcHjxc8eg8ve8666KKKvKWKeVRa4LhneY(9YyBiLUecnF3ly54KbGWQzfh42evLiKyhdFAc1vDQJsGCifzilGazKrg56vKC5jj4jdeiPK84Dfap4rdHf6ooHxMSxaGu6i0RHqsfM)2XyzKqrOxKjNtGqIvcTxuPMShHG8rriesiVMXgPixceqiXkH2lGEI6rk5LqOMh4644N77XiIxgBdHGddc18avz6cJ579rO7CqOttZBEvXDAycVmzVaa5qdH3cx3dnHZCif5i0ZOkiXi0(EmONOEKsNKieWCm8bWIQyiuoVmkLs78Ckv1eF8en9JqIvcTxu99nWBiLozOHgc7fP0jJCD0qe
    Edit:
    Forgot to mention, this is very roughly coded and could probably do with some optimization. It's just very basic work-in-progress stuff.
    Hi the solution is simple. I used this for my own WA artifact % text.

    local quality = GetInventoryItemQuality("player", 16)
    if (quality ~= 6) then
    return false
    end
    use this in your custom trigger to hide the aura.
    Last edited by Swiftshadow; 2017-02-13 at 10:06 AM.

  3. #3
    Quote Originally Posted by Swiftshadow View Post
    Hi the solution is simple. I used this for my own WA artifact % text.

    Code:
    local quality = GetInventoryItemQuality("player", 16)
    if (quality ~= 6) then
    return false
    end
    use this in your custom trigger to hide the aura.
    Thank you for the quick reply! Unfortunately, this trigger still doesn't seem to work for me. I even tried to invert it and have it check if the item in slot 16 is equal to quality 6 instead of is not equal to. If I check for is not equal to, the aura doesn't load at all. If I check for is equal to, it functions the same as running a check for HasArtifactEquipped did. Note, I said did. For some reason, after trying out your code snippet, HasArtifactEquipped suddenly stopped working at all and I've had to resort to returning a simple value of true to get the aura to display again at all, even after reloading UI and relogging. Not sure how that happens. I'm thinking it may have something to do with the custom duration info for the progress bar, so I may have to play around with that code as well... Unfortunately, I don't have time to do it right now, but I'll try to mess around with it some more tomorrow and see it modifying the custom duration info helps at all.

  4. #4
    Quote Originally Posted by Darsyek View Post
    Thank you for the quick reply! Unfortunately, this trigger still doesn't seem to work for me. I even tried to invert it and have it check if the item in slot 16 is equal to quality 6 instead of is not equal to. If I check for is not equal to, the aura doesn't load at all. If I check for is equal to, it functions the same as running a check for HasArtifactEquipped did. Note, I said did. For some reason, after trying out your code snippet, HasArtifactEquipped suddenly stopped working at all and I've had to resort to returning a simple value of true to get the aura to display again at all, even after reloading UI and relogging. Not sure how that happens. I'm thinking it may have something to do with the custom duration info for the progress bar, so I may have to play around with that code as well... Unfortunately, I don't have time to do it right now, but I'll try to mess around with it some more tomorrow and see it modifying the custom duration info helps at all.
    After my raid tonight, I try convert my text display WA artifact % to a progress bar for u. Cos mine seems to work alright. At least while I level a level 36 warrior (obviously no artifact weapon lols), there were not errors.

  5. #5
    A simple nil check to the first argument of C_ArtifactUI.GetArtifactInfo will do. The first argument is the itemID of the equipped artifact. It will be nil if you don't have an artifact equipped. This is the same check the default UI uses when it decides whether or not to display the default AP bar.

    Code:
    local equipped=C_ArtifactUI.GetEquippedArtifactInfo()
    if equipped then
        -- artifact is equipped
    else
        -- artifact is not equipped
    end

    Bonus points for simplicity, you can wrap the function in parenthesis to force only the first return and then treat it as its own boolean.

    Code:
    if (C_ArtifactUI.GetEquippedArtifactInfo()) then
        -- artifact is equipped
    end
    Last edited by Kanegasi; 2017-02-13 at 11:23 PM. Reason: GetArtifactInfo -> GetEquippedArtifactInfo
    Originally Posted by Zarhym (Blue Tracker)
    this thread is a waste of internet

  6. #6
    Quote Originally Posted by Kanegasi View Post
    A simple nil check to the first argument of C_ArtifactUI.GetArtifactInfo will do. The first argument is the itemID of the equipped artifact. It will be nil if you don't have an artifact equipped. This is the same check the default UI uses when it decides whether or not to display the default AP bar.

    Code:
    local equipped=C_ArtifactUI.GetArtifactInfo()
    if equipped then
        -- artifact is equipped
    else
        -- artifact is not equipped
    end

    Bonus points for simplicity, you can wrap the function in parenthesis to force only the first return and then treat it as its own boolean.

    Code:
    if (C_ArtifactUI.GetArtifactInfo()) then
        -- artifact is equipped
    end
    Pls try the above by Kanegasi. It should work. As a matter of fact I will probably change the argument in mine to that too.

    Thanks Kanegasi.

  7. #7
    Quote Originally Posted by Kanegasi View Post
    A simple nil check to the first argument of C_ArtifactUI.GetArtifactInfo will do. The first argument is the itemID of the equipped artifact. It will be nil if you don't have an artifact equipped. This is the same check the default UI uses when it decides whether or not to display the default AP bar.

    Code:
    local equipped=C_ArtifactUI.GetArtifactInfo()
    if equipped then
        -- artifact is equipped
    else
        -- artifact is not equipped
    end

    Bonus points for simplicity, you can wrap the function in parenthesis to force only the first return and then treat it as its own boolean.

    Code:
    if (C_ArtifactUI.GetArtifactInfo()) then
        -- artifact is equipped
    end
    Hm... I must be doing something seriously wrong somewhere, because adding the nil check again caused the aura to not load at all. I really don't know where I'm making the error... I've tried adding it to each custom trigger and each custom text display, and it either has no effect and the errors continue when the artifact is removed, or it causes the aura to not load at all, regardless of if I have an artifact equipped or not.

    I definitely have a lot of work to do if I want to get this thing to work perfectly...

  8. #8
    Oh my, I gave you the wrong function. My apologies. It's actually C_ArtifactUI.GetEquippedArtifactInfo(). I had to dive back into the UI code to reconfirm. If you're curious, here's the relevant line (144) in the default UI uses to determine whether or not to display the default AP bar. You can see it used to create a boolean along with whether it's maxed, player level being max, and AP bar setting on line 145 and then used to show or hide the bar on lines 167 to 193.

    Also, I'm not sure where you got HasArtifactEquipped(), but it is not used anywhere in the default UI. It is a valid default function though, but it seems it may not be reliable.
    Originally Posted by Zarhym (Blue Tracker)
    this thread is a waste of internet

  9. #9
    Quote Originally Posted by Kanegasi View Post
    Also, I'm not sure where you got HasArtifactEquipped(), but it is not used anywhere in the default UI. It is a valid default function though, but it seems it may not be reliable.
    I found the function looking through the list of global functions on Gamepedia's WoW page, though it has no documentation there either. I ran a dump on the data and it gave a reliable true or false for whether or not I had an artifact weapon equipped, so I can only assume that - if it's not used in the default UI - it must be a deprecated function. Presumably because they decided to just run a nil check on C_ArtifactUI.GetEquippedArtifactInfo() whenever they needed to check for an equipped artifact.

    Anyways, I noticed a bit of an oddity. If I log onto my rogue, who is sitting at level 37, I get no errors as anything that calls C_ArtifactUI returns "empty value." Not "nil", but exactly "empty value." As such, the aura doesn't constantly spit out errors, and it only does so on a character that has an artifact but doesn't have one equipped. It does, however, start spitting out the same errors when I open the WeakAuras options menu - which doesn't happen on my main characters at all, as opening the WeakAuras menu on a character with an artifact normally stops the errors from displaying in chat not trigger them. @_@

    Even with the nil check on C_ArtifactUI.GetEquippedArtifactInfo(), it seems to - again - function exactly like just running a check on HasArtifactEquipped(). I'm sort of at a loss at the moment because I can't think of a single reason why the aura is still trying to run and update custom text despite running a function that is supposed to be returning a false. The only thing I can really think of trying to do is to rewrite the whole thing and see if I accidentally introduced a weird quirk somewhere down the line that I just keep skimming over. The only other thing I can possibly think is that something is going wrong in my concatenating code.

    This is the code I have at the moment for the displays. Apologies if my code is a bit painful to read. It's kind of hacked together at the moment. :P
    Code:
    --[[Custom text on left side of bar, displays current AP]]
    function()
        if (C_ArtifactUI.GetEquippedArtifactInfo()) then
    		--[[Collect data values 5 & 6 (current AP and Artifact Rank/Level)]]
            local _,_,_,_,ap,lev = C_ArtifactUI.GetEquippedArtifactInfo();
            local t = {}
            thousands = ','
            decimal = '.'
            local int = math.floor(ap)
            local rest = ap % 1
            if int == 0 then
                t[#t+1] = 0
            else
                local digits = math.log10(int)
                local segments = math.floor(digits / 3)
                t[#t+1] = math.floor(int / 1000^segments)
                for i = segments-1, 0, -1 do
                    t[#t+1] = thousands
                    t[#t+1] = ("%03d"):format(math.floor(int / 1000^i) % 1000)
                end
            end
            if rest ~= 0 then
                t[#t+1] = decimal
                rest = math.floor(rest * 10^6)
                while rest % 10 == 0 do
                    rest = rest / 10
                end
                t[#t+1] = rest
            end
            apconcat = table.concat(t)
            wipe(t)
            return apconcat 
        end
    end
    
    --[[Custom text on right side of bar, display AP to next rank]]
    function()
        if (C_ArtifactUI.GetEquippedArtifactInfo()) then
    		--[[Collect data values 5 & 6 (current AP and Artifact Rank/Level)]]
    		--[[Most likely redundant, could probably remove.]]
            local _,_,_,_,ap,lev = C_ArtifactUI.GetEquippedArtifactInfo();
    		--[[Collect data value for AP required for next Artifact Rank/Level)]]
            local nextAP = C_ArtifactUI.GetCostForPointAtRank(lev);
            local t = {}
            thousands = ','
            decimal = '.'
            local int = math.floor(nextAP)
            local rest = nextAP % 1
            if int == 0 then
                t[#t+1] = 0
            else
                local digits = math.log10(int)
                local segments = math.floor(digits / 3)
                t[#t+1] = math.floor(int / 1000^segments)
                for i = segments-1, 0, -1 do
                    t[#t+1] = thousands
                    t[#t+1] = ("%03d"):format(math.floor(int / 1000^i) % 1000)
                end
            end
            if rest ~= 0 then
                t[#t+1] = decimal
                rest = math.floor(rest * 10^6)
                while rest % 10 == 0 do
                    rest = rest / 10
                end
                t[#t+1] = rest
            end
            local levconcat = table.concat(t)
            wipe(t)
            return levconcat 
        end
    end
    
    --[[Custom duration info for bar, runs a check against current and needed AP]]
    function()
        if (C_ArtifactUI.GetEquippedArtifactInfo()) then
    		--[[Collect data values 5 & 6 (current AP and Artifact Rank/Level)]]
            local _,_,_,_,ap,lev = C_ArtifactUI.GetEquippedArtifactInfo();
    		--[[Returns Current AP, AP to next Rank/Level, and true to enable]]
            return ap, C_ArtifactUI.GetCostForPointAtRank(lev), true end
        else return 0
        end
    end
    Last edited by Darsyek; 2017-02-14 at 02:23 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •