1. #1

    Weakauras Health Bar w/ 2 different custom functions for left and right

    Looking to make a health bar that always displays that lists an abbreviated current health and abbreviated maximum health on the left side of the bar ie 150k/320k and then the current percentage on the right side ie 46%.

    Im most of the way there but I cant get the right side text to display the current percentage

    For display im using %c for the left side and the function is

    function()
    return ("%.0fk / %.0fk"):format(UnitHealth("player") / 1000, UnitHealthMax("player") / 1000)
    end

    For the right side im attempting to use a custom trigger via a suggestion from another thread and displaying it w/ %n or %s but it won't show.

    settings are Custom / Status / Every Frame

    The custom function is

    function()
    return floor(UnitHealth("player")/UnitHealthMax("player")*1000)/10
    end

    in the Name Info or Stack Info box. The right side text doesn't show the HP% and disappears once I close WA or select a different aura.

    Seems simple enough and I figured I could just google and copy one but my google-fu skills are failing me. If anyone could fix or help out would be much appreciated. I have no clue what im doing w/ custom functions so please keep that in mind, what I have has been what ive managed to find online.

    This is as far as ive gotten

    Code:
    dmupeaGie5sssnkc1PivwLIknlevClrI2fc1VqGHrWXiXYaQNPinnvjDnGyBaPVjjmorkRdrvoiIkTqe0djvrtuKuxurfBurvFKuLmsfLtsQQwPivVuKKzQkLBQkv7us9tsvQHsQklLufEkQPQKRIq2l1FjKbdQdt0IruESQAYI4YsTzLYNjPrRkoTkRgrv9AjrZwHBdYUf1VLy4KYYr65cnDORly7Qs8DjjJxrCELQ1lsy)a2kEzgYCI5eVmVvY48dPA0SEt06n9xphZKjP6zzuOE5AfppOPPubyLPGaYuqslnWPj4TucYuxp1ZdkyfqRy6uqfMcUcWGvE1BPeKkmAwJwuPDmQpA)V4vYUwW8Oit8YmkhDg9YmuyGNxgnAoeBr)HmgnHMPLr7LzOWapVmA08M8Jxj7LzOWapVmA08FiJrVmhVS6OnN65qURzPQw)61SLrZj3229ddC3lZqHbEEz0OzQ83EzgkmWZlJgnA(hIybArpv1M(wr9(MntB1RKx7ATzzGkjtsnhr5VYOjZ8Lpu0VaPnAStCTIzSNGbAB(9lFqYXfrZjxK8d5pEV0M)HiwGm)drSaT6jO5Tq(Jxjlwhq6aWaWaWaW0gd0maSysvtSWwLaWeaaxnXcBvssh5TvOqsumr5dN1Yb(iMK2qU3us6aGjaawrqqGCaGjkF4SwoWN3LtetsBi3BkjDaWeaaRiiiOdi9oNyg7jiFPODTIGzKEQQn1lZHylsRuvtnzM1kv1uCxRDnOMdXwKwPQMI7ATj08peXcKONlPnJhuNyg31AZ)qelqMd5(LoJMLbSyoeBrH8HMqZ)qelq1sO28wi)XRKfRdiDayayayayAJbAgaEBukuXeLpCwlh4JysAd5EtjPJaIYhoRLd85D5eXK0gY9Mss3Cveee0rGIaq6DoX8peXcKzZ)N(xP5GwIeBZ)qelqIWDT2CeLyiA0Smj5WRKLdri9uvBA0lJMXdQP8LI21kcMVFjBYmNdql6PQ20ORvmNCrTHCF1tW36n0C1FZybLd9r7)fVs21cMdzKEQQn1lZH8HM1gY9MAoeBrH8HMqJMVeZPUL4daCQYN6dcapRLd8baMqjfagS5KlQnK7REcQhN6dAU6S5QUe8X1GbdI5N(uFqxR8QrZrZGjwHybIbdQ5xCTYRGvmAd
    Last edited by Michael000; 2016-05-17 at 08:28 PM.

  2. #2
    Grunt Diceyi's Avatar
    Join Date
    May 2016
    Location
    Warlock Den
    Posts
    24
    Ahoy there,

    I was able to make the Weak Aura for you that does what you are requesting. For instance on my Warlock it shows 658k / 658k and 100 on the right side for my health percentage. I also made the bar go down as your health decreases in case you wanted that to happen as well.

    Weak Aura Import String
    [code]d0t2daGEsf6LOu0UarBdLsMPsuFgLmBbhgv3Ks0VaHBdQhd0obP9QA3KSFIFsQIHrk)wrNxHonsdgXWvsheLQ6uI4y IYOOsleLclvbPftQulNIfjsRsbXYauRdLknrsLmvLAYIQPdDrsv6QusxwQ3biBKubNKurBMk2UsO)sQQzPezAkO(ok vmsaEokgnLA8kWLOeUUqxdLsDpuQYkPQNk51kb)SVFb)k)v(3Vyqo4cmfvh7dnt71OECCyA8qZgw7LZuH6qGZI5LES UxwNq17RWKN)9RCQJdfmgWXVFbhdi97JhFzMH(7xWXas)(4Xxgoy)9l4yaPFF84lKhAf(9l4yaPFF84lhoisNQVFbh di97Jhp(Y0SOt1ECTFXJgUU5Mxuff1hCcVgASZp0SxypaJM(LLuffMhOm4lWidoH39a8LtubI0PYnr8cricriMgJgL qCtTasnNfececXci1CwinHDDMgyo6AvrranpG2UPRb(yBstececjtttBjHyvrranpG2wYh4MUg4JTjnriqiKmnnTeG eFRYfV4fV4FLtzwd8XDpaxUDWxwa(cnuwSAZ3VWX1(fyKbNWVaJm4ewxrdhPt1lNOcePtLBI4fIqeIqaJganpG2cH9 eItyonUUwvueqZdOTB6AGp2M0eiSQOiGMhqBl5dCtxd8X2KMKmKmnTeGeVqeIqeIPXOrjeWObqZdO9szAAlHMydKqe IqeFRYfV4fV4fV4fV4fV4f)lWidoHHYH7xorfisNk3eXleHieHyAmAucXjmNgxRkkcO5b02nDnWhBtAcewvueqZdOT L8bUPRb(yBstgsMMwcqIVv5Ix8Ix8VaJm4e(LtubI0PYnr8cricriMgJgLqqtSbs8Tkx8Ix8VaJm4ewFCCTF1l2k8v VyRqMxwHQZT(a0l7V8gWlWidoH13MM3VaJm4e(4lveEBOSy1gMdn7LDtzzJhA2WVYPmRb(4UhGdLYYgFzH6fn)LUAo Ale2urzzJcbqZdOTqydU5f7qZr7dfyGz7xuWP66(4lMxadzgKAqcmB9AXdnByGZo(d[/[code]]


    Actual Code
    Trigger 1 - Custom
    Event Type: Event
    Event(s): UNIT_HEALTH

    Custom Trigger
    function()
    return true;
    end

    Duration Info
    function()
    curHealth = floor((UnitHealth("player")/UnitHealthMax("player"))*100);
    return curHealth,100,true;
    end

    Name Info
    function()
    return floor(UnitHealth("player")/UnitHealthMax("player")*100);
    end

    Display
    Left Text: %c
    Right Text: %n

    Custom Function
    function()
    return ("%.0fk / %.0fk"):format(UnitHealth("player") / 1000, UnitHealthMax("player") / 1000);
    end
    If you do not want your health bar to decrease as your health bar decreases remove the information in Duration Info

    If you have any questions about any of the code feel free to let me know.

    - - - Updated - - -

    Ahoy there,

    I was able to make the Weak Aura for you that does what you are requesting. For instance on my Warlock it shows 658k / 658k and 100 on the right side for my health percentage. I also made the bar go down as your health decreases in case you wanted that to happen as well.

    Weak Aura Import String
    Code:
    d0t2daGEsf6LOu0UarBdLsMPsuFgLmBbhgv3Ks0VaHBdQhd0obP9QA3KSFIFsQIHrk)wrNxHonsdgXWvsheLQ6uI4yIYOOsleLclvbPftQulNIfjsRsbXYauRdLknrsLmvLAYIQPdDrsv6QusxwQ3biBKubNKurBMk2UsO)sQQzPezAkO(okvmsaEokgnLA8kWLOeUUqxdLsDpuQYkPQNk51kb)SVFb)k)v(3Vyqo4cmfvh7dnt71OECCyA8qZgw7LZuH6qGZI5LESUxwNq17RWKN)9RCQJdfmgWXVFbhdi97JhFzMH(7xWXas)(4Xxgoy)9l4yaPFF84lKhAf(9l4yaPFF84lhoisNQVFbhdi97Jhp(Y0SOt1ECTFXJgUU5Mxuff1hCcVgASZp0SxypaJM(LLuffMhOm4lWidoH39a8LtubI0PYnr8cricriMgJgLqCtTasnNfececXci1CwinHDDMgyo6AvrranpG2UPRb(yBstececjtttBjHyvrranpG2wYh4MUg4JTjnriqiKmnnTeGeFRYfV4fV4FLtzwd8XDpaxUDWxwa(cnuwSAZ3VWX1(fyKbNWVaJm4ewxrdhPt1lNOcePtLBI4fIqeIqaJganpG2cH9eItyonUUwvueqZdOTB6AGp2M0eiSQOiGMhqBl5dCtxd8X2KMKmKmnTeGeVqeIqeIPXOrjeWObqZdO9szAAlHMydKqeIqeFRYfV4fV4fV4fV4fV4f)lWidoHHYH7xorfisNk3eXleHieHyAmAucXjmNgxRkkcO5b02nDnWhBtAcewvueqZdOTL8bUPRb(yBstgsMMwcqIVv5Ix8Ix8VaJm4e(LtubI0PYnr8cricriMgJgLqqtSbs8Tkx8Ix8VaJm4ewFCCTF1l2k8vVyRqMxwHQZT(a0l7V8gWlWidoH13MM3VaJm4e(4lveEBOSy1gMdn7LDtzzJhA2WVYPmRb(4UhGdLYYgFzH6fn)LUAoAle2urzzJcbqZdOTqydU5f7qZr7dfyGz7xuWP66(4lMxadzgKAqcmB9AXdnByGZo(d
    Actual Code
    Trigger 1 - Custom
    Event Type: Event
    Event(s): UNIT_HEALTH

    Custom Trigger
    function()
    return true;
    end

    Duration Info
    function()
    curHealth = floor((UnitHealth("player")/UnitHealthMax("player"))*100);
    return curHealth,100,true;
    end

    Name Info
    function()
    return floor(UnitHealth("player")/UnitHealthMax("player")*100);
    end

    Display
    Left Text: %c
    Right Text: %n

    Custom Function
    function()
    return ("%.0fk / %.0fk"):format(UnitHealth("player") / 1000, UnitHealthMax("player") / 1000);
    end
    If you do not want your health bar to decrease as your health bar decreases remove the information in Duration Info

    If you have any questions about any of the code feel free to let me know.

    - - - Updated - - -

    Sorry for the weird formatting in the above post. No idea why it formatted like that.

  3. #3
    Thanks a TON. This is exactly what I was looking for as I did want the bar to decrease as I lost HP.

    The one thing if you could help me out one last time is to have the percentage round up to the nearest whole number as opposed to showing the exact percentage w/ the lone decimal.
    Last edited by Michael000; 2016-05-18 at 04:59 PM.

  4. #4
    Grunt Diceyi's Avatar
    Join Date
    May 2016
    Location
    Warlock Den
    Posts
    24
    Quote Originally Posted by Michael000 View Post
    Thanks a TON. This is exactly what I was looking for as I did want the bar to decrease as I lost HP.

    The one thing if you could help me out one last time is to have the percentage round up to the nearest whole number as opposed to showing the exact percentage w/ the lone decimal.
    No problem! I am glad that you wanted the bar to decrease as you lost HP. As far as the percentage rounding up when I am testing it I see only whole numbers. It shouldn't show any decimal values. If you could provide a screenshot indicating what you are referring to that would be great in helps to troubleshoot.

Posting Permissions

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