1. #1

    Weakauras bar color question.

    So a quick question for those of you out there more knowledgeable about the custom animations options in Weakauras...

    For Mists I'm making the transition from Hunter to Bear and want to have a Weakauars bar to track my rage. Specifically I want the bar to be red when I have 0-59 rage, and green when I have 60+ rage. I'm assuming that this is possible because Weakauras is frankly amazing and I can't possibly believe that Weakauras can't do this. Anyone know how to do this (or something very close to this), because I'm failing miserably to figure this out.

  2. #2
    Try this. If it works for you then I'll beef it up a little to support energy/rage/runic power/etc and add a video to the weak auras tutorials.

    Under animations scroll down to the "colors" function and hit "expand edit"

    at the top you'll see a bunch of lines:
    colors_for_rage[0] = {red = 1, green = 0, blue = 0}
    colors_for_rage[33] = {red = 1, green = 1, blue = 0}
    Every time you cross one of those thresholds (have more than, not equal to) your rage bar will switch to the colors defined.
    You'll start out with a red rage bar (RGB: 1, 0, 0) and then when you have 34 or more rage you'll switch Yellow (RGB: 1,1,0) and finally
    at 66 rage your bar will turn green.

    You can define any set of color thresholds you like by adding them to the list. If you wanted a blue bar at full rage then you'd just add:
    colors_for_rage[99] = {red = 0, green = 0, blue = 1}
    I did a bit of testing with my warrior on some target dummies and it seemed to behave as advertised. Since you're interested in weak auras I'm assuming you can figure out other configuration options on your own (load conditions, text options, etc).
    Last edited by evn; 2012-08-26 at 06:15 PM.

  3. #3
    You, good sir, are a wonderful human being. Now if only I could open the stupid game to have a fiddle with this... (stupid battle.net not responding again...). I can sort all the rest of it out I'm sure as I've been using Weakauras for about 6 months now, just not what one might describe as a power user

    When I can log in I'll have a good play with it but it sounds exactly right. Oh, and huge kudos to you for replying on youtube so quickly!!

  4. #4
    Hey Evn.

    Finally got in the game to test this and the code string seems to be wrong. Weakauras returns "Error decompressing: Cannot decode map". I'm guessing your copy/paste missed out something crucial. Any chance you could repost the code string?

  5. #5
    Worked perfectly for me. Thanks very much!

  6. #6
    It imported okay for me - try making sure there is no extra white space at the start or end when you copy/paste.

  7. #7
    hmmmmm, i'll go have another look now.

    ---------- Post added 2012-08-30 at 05:07 PM ----------

    Yeah, just had some extra white space. My bad (hangs head in shame...). Thanks again, Evn.

  8. #8
    Legendary! Volitar's Avatar
    Join Date
    Nov 2009
    A better expansion.
    Hello I just imported the string and I seem to be having some trouble. I can change the rage threshold for the 2nd color (yellow) but when I try and change the 3rd threshold every rage over my custom yellow threshold is yellow.

    If anyone is good at weak auras I would really appreciate the help. If it matters I want to set me 2nd threshold at 20 for Shield Barrier and 3rd threshold at 60 for Shield Block.

  9. #9
    Grunt Scrooloose's Avatar
    Join Date
    Jan 2011
    Lancashire, England, UK
    Took me ages to find how to do this but google finally came up with your thread, thanks very much for the help!

  10. #10
    Blademaster Skillfall's Avatar
    Join Date
    May 2014
    Day made!!!!

  11. #11
    function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
    local colors_for_rage = {}
    -- when you reach "X" rage set the red/green/blue colors for rage.

    colors_for_rage[0] = {red = 1, green = 0, blue = 0} -- red: need 15 rage for devestate
    colors_for_rage[59] = {red = 1, green = 1, blue = 0} -- yellow: everythign is good
    colors_for_rage[119] = {red = 0, green = 0, blue = 1} -- full rage

    local red, green, blue = colors_for_rage[0].red, colors_for_rage[0].green, colors_for_rage[0].blue

    local player_rage = UnitPower("player", 1)
    for threshold, rage_colors in pairs(colors_for_rage) do
    if player_rage > threshold then
    --print(string.format("%i %i", player_rage, threshold))
    red, green, blue = rage_colors.red, rage_colors.green, rage_colors.blue


    return red, green, blue, 1
    I tried to get a blue color when reach 120 rage (war) and it is not working.

    Red and Yellow are working, no blue one

    I would like to have the number of rage centered too, not on right side

    Any help will be great
    Last edited by epurator; 2014-11-10 at 08:33 AM.

  12. #12
    Tables are indexed from 0 because of the ">" comparison. You can't have > 120 rage.
    Change the number you're comparing to 119 like the comment says.

  13. #13
    Thanks Evn

    it is not working with 119 but with 118.

Posting Permissions

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