1. #1
    Stood in the Fire
    10+ Year Old Account
    Join Date
    Oct 2010
    Location
    Dallas, Tx
    Posts
    375

    Weakaura Display Stats

    I'm trying to create a weakaura string that will display my crit, haste and mastery, either rating or %.

    I tried looking it up and found a few entries from google. Not being a coder, I'm afraid my attempts to cut, paste and modify the functions didn't work.

    I found a few addons that would do this, but they either were out of date, required another addon to display, or I just didn't like them.

    Any help would be greatly appreciated!
    Human decency is not derived from religion. It precedes it.

  2. #2
    The Patient
    15+ Year Old Account
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    319
    http://www.wowwiki.com/API_GetCombatRating
    http://wowprogramming.com/docs/api_categories#stats

    Make a text string in Weak Auras, put in %c for custom and add the following to the custom function (don't touch trigger at all)
    Code:
    function() 
        return ("Mastery Rating: ".. GetCombatRating(26))
    end
    You get the idea!
    Last edited by suprep; 2013-05-13 at 12:27 PM.

  3. #3
    ^ if he doesn't edit the trigger it'll update every frame - that's not ideal because it's a lot of extra processing for no good reason.
    Changing it to fire on events like COMBAT_RATING_UPDATE would reduce the updates noticeably (hundred+ times less cpu intensive).

  4. #4
    The Patient
    15+ Year Old Account
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    319
    Good point, completely forgot about the update rate.

  5. #5
    Stood in the Fire
    10+ Year Old Account
    Join Date
    Oct 2010
    Location
    Dallas, Tx
    Posts
    375
    Thanks! I'll give this a try and appreciate the links. I'll read up on it.
    Human decency is not derived from religion. It precedes it.

  6. #6
    I've spent sometime doing some weakaura tweaking to display stats, only haste worked for me till now. so I figured out my formulas for crit and dodge are wrong so i've been searching to find the MoP formulas for each spec but i cant find anything, any help please?

  7. #7
    Quote Originally Posted by Mandibleclaw View Post
    I've spent sometime doing some weakaura tweaking to display stats, only haste worked for me till now. so I figured out my formulas for crit and dodge are wrong so i've been searching to find the MoP formulas for each spec but i cant find anything, any help please?
    I haven't tried these but it seems pretty straightforward from the API...

    GetDodgeChance()
    GetCritChance()
    GetSpellCritChance(schoolID)

  8. #8
    Quote Originally Posted by Mandibleclaw View Post
    I've spent sometime doing some weakaura tweaking to display stats, only haste worked for me till now. so I figured out my formulas for crit and dodge are wrong so i've been searching to find the MoP formulas for each spec but i cant find anything, any help please?
    You shouldnt bother on calculating anything. If the info you seek is shown in character pane (what do you seek? % values), then most probably the WOW API already has a function that returns it. Get into wowprogramming.com or wow api on wowwiki and give it a search.

  9. #9
    Quote Originally Posted by wkrueger View Post
    You shouldnt bother on calculating anything. If the info you seek is shown in character pane (what do you seek? % values), then most probably the WOW API already has a function that returns it. Get into wowprogramming.com or wow api on wowwiki and give it a search.
    okay that was useful I found the api functions, used 1 and it worked like a charm, all I need is round the number now thx

  10. #10
    Code:
    function ()
        local now             = GetTime();
        WA_STATS_LAST_UP = WA_STATS_LAST_UP or now - 1;
        if now >= WA_STATS_LAST_UP + 0.1 then
            WA_STATS_LAST_UP = now;
            
            local int              = select(1, UnitStat("player", 4));    
            local mas              = GetMasteryEffect();                         
            local has              = UnitSpellHaste("player");                     
            local crit              = GetSpellCritChance(6);                
            local dmg              = GetSpellBonusDamage(6);                
            
            WA_STATS_RETURN = string.format([[
    Int: %.0f
    Mastery: %.1f
    Haste: %.1f
    Crit: %.1f
    Damage: %.0f]], 
                int or 0,
                mas or 0, 
                has or 0, 
                cri or 0,
                dmg or 0
            );
        end
        
        return  WA_STATS_RETURN or "<no data>";
    end
    a working function that include stats in %, tested in 5.4
    Last edited by Archimand; 2013-10-15 at 12:18 PM.
    "The speed of light is faster than the speed of sound.
    That's why so many people look smart until they start talking."

    FC-0404-6893-4293 Fire safari Larvesta/Growlithe/Braixen IGN: X Archimand, Y Shina.

  11. #11
    You can also check out TinyCasterStats

    If you don't care for that display or it's options you should be able to rip out any code you need in to a WeakAura as well.

    Best of luck to you in your endeavor!
    Virtualize <Solution> @ Greymane | virtual#1157 | Web | YouTube | Twitter | Facebook
    Hermes - Share cooldown status with raid/party.
    Skada: Survivability - Show when a character died during a specific attempt.
    AffDots - Track the potency of your DoTs on a target.

  12. #12
    I have been looking for something like this as well. Thank you very much

  13. #13
    Deleted
    Quote Originally Posted by Archimand View Post
    Code:
    function ()
        local now             = GetTime();
        WA_STATS_LAST_UP = WA_STATS_LAST_UP or now - 1;
        if now >= WA_STATS_LAST_UP + 0.1 then
            WA_STATS_LAST_UP = now;
            
            local int              = select(1, UnitStat("player", 4));    
            local mas              = GetMasteryEffect();                         
            local has              = UnitSpellHaste("player");                     
            local crit              = GetSpellCritChance(6);                
            local dmg              = GetSpellBonusDamage(6);                
            
            WA_STATS_RETURN = string.format([[
    Int: %.0f
    Mastery: %.1f
    Haste: %.1f
    Crit: %.1f
    Damage: %.0f]], 
                int or 0,
                mas or 0, 
                has or 0, 
                cri or 0,
                dmg or 0
            );
        end
        
        return  WA_STATS_RETURN or "<no data>";
    end
    a working function that include stats in %, tested in 5.4
    The ''cri or 0,'' should be ''crit or 0,'' for this to work.
    or the ''local crit'' should be ''local cri''.

    I have another question.
    Is it possible to have a progress bar growing with the increase of spell power gain, and decrease again when your procs are fading.?

  14. #14
    Can anyone help with displaying Armor rating in % for my druid?

  15. #15
    Honorary PvM "Mod" Darsithis's Avatar
    10+ Year Old Account
    Join Date
    Jan 2011
    Location
    Chicago
    Posts
    51,235
    Create new threads, please don't necro old ones. The available commands and interfaces change too often for years-old threads to be applicable.

Posting Permissions

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