1. #1
    Deleted

    Shortened numbers with WeakAuras

    Hello everyone,
    i use WeakAuras to track the potency of my ignite.
    In the Display-Tab i have entered %s in the Text-field.

    My "problem" is that this shows me the full number (for example 12345).
    Is it possible to show this number in a short way like 12(k) ?

    Thank you in advance <3

  2. #2
    Deleted
    Yes it is. Write %c in the text field instead and put this function into the text editor:
    Code:
    function () 
        
        local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Ignite")
        if(value > 999999) then value = math.floor(value/1000000) .. "M" end
        if(value > 999) then value = math.floor(value/1000) .. "k" end
        return(value)
    end
    123 will still display as 123
    12345 will display as 12k
    1234567 will display as 1M, which might not be of much interest when it comes to ignite but perhaps usable for other buffs.

  3. #3
    Deleted
    Thank you for your answer but unfortunately when i paste this into the code box i get this lua error:

    Message: [string "return function () ..."]:4: attempt to compare number with nil
    Time: 08/03/13 21:58:02
    Count: 6660
    Stack: [C]: ?
    [string "return function () ..."]:4: in function <[string "return function () ..."]:1>
    Interface\AddOns\WeakAuras\RegionTypes\icon.lua:208: in function `UpdateCustomText'
    Interface\AddOns\WeakAuras\WeakAuras.lua:4967: in function <Interface\AddOns\WeakAuras\WeakAuras.lua:4963>

  4. #4
    between line 3 and 4 add a new line
    Code:
    value=value or 0

  5. #5
    Deleted
    That fixed the lua error but the number is always zero now.
    Maybe there is an error getting the value?

    Im very bad at lua but the thing with ignite is that you have to get the size via the tooltip. Maybe that is the problem?
    Other than that its a debuff on my target. Maybe thats the issue since it says "player" in the code?

    Im totally clueless :P

  6. #6
    Deleted
    Quote Originally Posted by turtlefreak View Post
    Other than that its a debuff on my target. Maybe thats the issue since it says "player" in the code?
    That should be "target". Other than that, code looks good at first glance.

  7. #7
    It's probably because you need to use UnitDebuff or UnitAura instead of UnitBuff. You should also add a PLAYER filter otherwise you're going to see whacky things with other fire mages in the raid.
    Code:
    function ()
        local value = select(15, UnitDebuff("target", "Ignite", nil, "PLAYER")) or 0
        if value > 999999 then
            value = math.floor(value/1000000) .. "m"
        elseif value > 999 then
            value = math.floor(value/1000) .. "k"
        end
        return value
    end


    Druid / Demon Hunter SimulationCraft Maintainer

  8. #8
    Deleted
    Alright, I should stop saying "it looks fine" without really reading the code thoroughly.

  9. #9
    Deleted
    thank you so much everyone, the code aggixx posted works like a charm
    Last edited by mmoc2e5b8dbff7; 2013-08-05 at 12:53 PM.

  10. #10
    Hi, trying to use this one on my blood DK to track Umbilicus Eternus buff (absorb from Vampiric Blood when it expired). Its not working obviously but dunno what should i change in that Lua to make it work (i guess "player" for me as a target is ok, i probably should replace this ignite with Umbilicus Eternus somehow). Any help possible?

Posting Permissions

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