WeakAuras

Haste Tracking

  • 11 posts
    #1 Oct 27, 2011 at 21:36 UTC - 0 likes

    Hi, LOVE this add-on.

    I've done numerous Google searches, but nothing ever seems to turn up.

    I'm currently using a broker stat add-on to see my current haste percentage.

    I'd love to get rid of that add-on, and just use weakauras to do it instead.

    Basically, I'd like text saying "Haste: ??.??%" that updates whenever my haste changes that I can drag down over my broker display, and when my haste reaches 30.02% or higher, a visual aura pops up around my player.

    Is there any way to do this?

    Last edited Oct 27, 2011 by Zuedama
    #2 Oct 28, 2011 at 17:24 UTC - 0 likes

    Use a text display. As trigger use something that is true when you need it. (Eg. Conditions trigger, not mounted, ect.)

    Than use this as custom text function:

    -- Custom text function
    function ()
        -- Don't change this (update every second only)
        local now             = GetTime();
        WA_STATS_LAST_UP = WA_STATS_LAST_UP or now - 1;
        if now >= WA_STATS_LAST_UP + 0.1 then
            -- Shedule next update
            WA_STATS_LAST_UP = now;
            
            -- Current values
            local int              = select(1, UnitStat("player", 4));     -- Int (http://wowprogramming.com/docs/api/UnitStat)
            local mas              = GetMastery();                         -- Mastery
            local has              = GetRangedHaste();                     -- Haste
            local cri              = GetRangedCritChance();                -- Crit
            local dmg              = GetSpellBonusDamage(6);                -- SHADOW Spell-Damage (http://wowprogramming.com/docs/api/GetSpellBonusDamage)
            
            -- Return text
            WA_STATS_RETURN = string.format([[
    Int: %.2f
    Mastery: %.2f
    Haste: %.2f
    Crit: %.2f
    Damage: %.2f]], 
                int or 0,
                mas or 0, 
                has or 0, 
                cri or 0,
                dmg or 0
            );
        end
        
        return  WA_STATS_RETURN or "<no data>";
    end
    

    Regarding showing aura once a stat reaches a certain value:

    • Type: Custom, Event
    • Events: UNIT_STATS, UNIT_AURA [Note: UNIT_AURA might not be necessary]
    • Show code:
    function (event, unitId)
       -- Ignore others
       if unitId ~= "player" then return end
    
        -- Current values
        local int              = select(1, UnitStat("player", 4));     -- Int (http://wowprogramming.com/docs/api/UnitStat)
        local mas              = GetMastery();                         -- Mastery
        local has              = GetRangedHaste();                     -- Haste
        local cri              = GetRangedCritChance();                -- Crit
        local dmg              = GetSpellBonusDamage(6);                -- SHADOW Spell-Damage (http://wowprogramming.com/docs/api/GetSpellBonusDamage)
    
        -- Note: Replace <...> with the value you want
        -- Remove lines you don't want to "query"
        if 
           int >= <INT>
        or mas >= <MAS>
        or has >= <has>
        or cri >= <cri>
        or dmg >= <dmg>
        then
          return true;
        end
    end
    
    • Hide code:
    function (event, unitId)
       -- Ignore others
       if unitId ~= "player" then return end
    
        -- Current values
        local int              = select(1, UnitStat("player", 4));     -- Int
        local mas              = GetMastery();                         -- Mastery
        local has              = GetRangedHaste();                     -- Haste
        local cri              = GetRangedCritChance();                -- Crit
        local dmg              = GetSpellBonusDamage(6);                -- Spell-Damage
    
        -- Note: Replace <...> with the value you want
        -- Remove lines you don't want to "query"
        if 
           int < <INT>
        or mas < <MAS>
        or has < <has>
        or cri < <cri>
        or dmg < <dmg>
        then
          return true;
        end
    end
    
    Last edited Oct 29, 2011 by CommanderSirow
    #3 Oct 28, 2011 at 21:41 UTC - 0 likes

    You're amazing. I'm gonna try it out right now. =)

    #4 Oct 28, 2011 at 22:10 UTC - 0 likes

    Okay, for the text display, I was able to whittle this down to:

    -- Custom text function
    function ()
        -- Don't change this (update every second only)
        local now             = GetTime();
        WA_STATS_LAST_UP = WA_STATS_LAST_UP or now - 1;
        if now >= WA_STATS_LAST_UP + 0.1 then
            -- Shedule next update
            WA_STATS_LAST_UP = now;
            
            -- Current values
    
            local has              = UnitSpellHaste("player");                     -- Haste
            
            -- Return text
            WA_STATS_RETURN = string.format([[
    Haste: %.2f]], 
                has or 0
    		);
        end
        
        return  WA_STATS_RETURN or "<no data>";
    end
    

    Since I only wanted haste to be displayed, and changing GetRangedHaste(); to UnitSpellHaste("player") allowed me to show my entire haste with talent buffs, etc.

    Now onto the aura displays =)

    Thanks again so much. This was exactly the kind of pre-made code I needed to go through to get me started in the right direction. <3

    Last edited Oct 28, 2011 by Zuedama
    #5 Oct 28, 2011 at 22:46 UTC - 0 likes

    Hmmm .. not able to get the visual "haste >" display working ... These are the changes I made:

    function (unitId)
       -- Ignore others
       if unitId ~= player then return end
    
        -- Current values
        local has              = UnitSpellHaste("player");
    
        if 
        has >= 30.02
        then
          return true;
        end
    end
    
    
    
    function (unitId)
       -- Ignore others
       if unitId ~= player then return end
    
        -- Current values
        local has              = UnitSpellHaste("player");
    
        if 
        has < 30.02
        then
          return true;
        end
    end
    
    #6 Oct 29, 2011 at 08:18 UTC - 0 likes

    My bad, I updated the last trigger. If it still does not update at certain occasions, change to:

    • Type: Custom, Status, Every Frame

    Short example:

    function (event, unitId)
       -- Ignore others
       if unitId ~= "player" then return end
    
        -- Current values
        local has              = UnitSpellHaste("player");
    
        if 
        has >= 30.02
        then
          return true;
        end
    end
    
    function (event, unitId)
       -- Ignore others
       if unitId ~= "player" then return end
    
        -- Current values
        local has              = UnitSpellHaste("player");
    
        if 
        has < 30.02
        then
          return true;
        end
    end
    
    Last edited Oct 29, 2011 by CommanderSirow
    #7 Oct 29, 2011 at 22:46 UTC - 0 likes

    Works PERFECTly with UNIT_STATS, UNIT_AURA.

    Many thanks.

    #8 May 02, 2012 at 04:25 UTC - 0 likes

    @Zuedama: Go

    Ok just wondering but would there be anyway that somone could modify this to just show melee haste without the 30.02 conditional. I would like to keep track of how much haste i am actually hitting in a raid enviroment and i don't want to pull up my character pane. Plus to save some time if someone would like to attempt this could you please post an import string instead of the code as im not real sure how to post it into WA

    Thanx Melvang

    Edit: Ok I am muddling my way through editing the post by CommanderSirow and just using the top portion as I can use that for a nice filler in my UI. the one issue i am having is editing the shadow spell damage line/s to get it to show my melee attack power

    Last edited May 02, 2012 by Melvang: experimenting
    #9 Feb 10, 2013 at 20:40 UTC - 0 likes

    yeah sure brain dead wanna-be lua coder. codes are great but not explaining where to put the codes very clearly just made your aura that you're so proud of worth a whole lot of nothing and it doesn't even work. how bout and updated in depth detailed step by step walk-through before posting on something. proud that yours works, but not proud enough to post on a forum and then explain so others can gratify you that you really did make a great aura.

    #10 Feb 25, 2013 at 09:55 UTC - 0 likes

    Raging at necro'd threads LOL TY Mirror, Commander Sirow et al for creating and maintaining this great addon

    Last edited Feb 25, 2013 by machinelf
    #11 Sep 10, 2013 at 17:48 UTC - 0 likes

    Hello everybody, First, sorry for my bad English.

    OK, I play wow in 3.3.5a version as Warlock and i use WeakAuras. I configured the addon to show all my dots and is working fine. the only thing you can not setup is show in the GUI my haste rating as it is changing during battle. But I have no idea how to do it. I read all the posts here and still could not learn. Can you help me, step by step, please?!

    Thank you.

    • lock.jpg
  • 11 posts

You must login to post a comment. Don't have an account? Register to get one!