1. #1

    [BFA] Weak Aura to track honor gained since last log-in.

    I found this weak aura on wago (2 years old): https://wago.io/H1f1lspRX

    There is an issue with the weak aura when entering and leaving a BG. The current honor I have gets added to the honor gained since last log-in, both when entering a BG and leaving.

    Example:
    - My honor is at 7000/8800
    - Left number says 0 when I log in (correct)
    - When I enter a BG it goes to 7000
    - I earn 200 honor during the BG, now it's at 7200
    - When I leave, my current honor is added to the number again, now it says 14200 (it should say 200)

    Could anyone take a look at the custom code and see if there is a way to fix it? All the other honor farming weak auras I could find were for classic, not bfa.

  2. #2
    I honestly had a difficult time following what that author was doing with the math, but it looked like they were trying to cumulatively add to a value they kept saving without actually keeping track of the session's starting point. In the custom display function, replace it all with the following code:

    Code:
    function()
        --start at 0 each update
        local display=0
        local honor=UnitHonor("player")
        local max=UnitHonorMax("player")
        local level=UnitHonorLevel("player")
        if not WA_HonorBar_Honor then
            --starting honor and level
            setglobal("WA_HonorBar_Honor",honor)
            setglobal("WA_HonorBar_Level",level)
        end
        --save each level's max
        setglobal("WA_HonorBar_Max_"..level,max)
        --calculate each level
        for i=WA_HonorBar_Level,level do
            if level==WA_HonorBar_Level then
                --current level is the starting level, current-start only
                display=honor-WA_HonorBar_Honor
            elseif i==WA_HonorBar_Level then
                --the first level in the session, max-start
                display=getglobal("WA_HonorBar_Max_"..i)-WA_HonorBar_Honor
            elseif i==level then
                --the current level, cumulative+current
                display=display+honor
            else
                --any levels between starting level and current level, add entire max
                display=display+getglobal("WA_HonorBar_Max_"..i)
            end
        end
        return display
    end

    Keep in mind that your starting point is wiped if you /reload your UI, since WeakAuras does not provide a method for auras to save data outside the UI, so auras can't tell the difference between logging in and reloading. I did some simple testing by forcing different honor and levels, the resulting value on the left worked with my testing.
    Originally Posted by Zarhym (Blue Tracker)
    this thread is a waste of internet

  3. #3
    Thank you Kanegasi, the code you made works great.

Posting Permissions

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