Page 1 of 2
1
2
LastLast
  1. #1
    Dreadlord Ogait's Avatar
    Join Date
    Jul 2009
    Location
    Portugal
    Posts
    753

    [WeakAuras] - A few questions

    Hello Guys,

    I've always used Weak Auras to track a few things for me, which I had no problems with it, but now I'd love to know if someone could help me out with other tracks.

    I've created a Group for Council of Elders 10H, which will show me how many stacks each player on the raid has from Soul Fragment, so I can coordinate who takes the next Fragment, so I can split the debuffs evenly through the raid.

    So far, I choose Text and typed this [ %s ] - Raid Member Name and with a trigger on Specific Unit (Player Name) and Debuff, with Shadowed Soul and it's working like a charm, but I was wondering this:

    - Is it possible to have this aura enabled, even if no one has the debuff? So I see [ 0 ] - Pandamorium and my entire raid?


    As you can see, my Tanks don't have the debuff so it doesn't appear their name, but I wanted to see their name with 0 stacks! :P

    - Is it possible to add some conditions to what appears to change color of Text?

    I mean, if less than 6 stacks, name appear in Green, between 6 as 12 as yellow, above 12 appear as red? I am the one splitting the stacks and some times with all the random factors of the fight, being a healer I lose 1-2 seconds checking who should get the debuff :P

    - Is it possible to track this using a specific Unit and instead of typing my raid name on the 10 different Auras, is it possible to track through Raid Member and appear their name written?

    Thanks a lot,
    ~ Pandamorium / Ogait
    Realm First Monk & Hellscream's Downfall

  2. #2
    You could do it.....but you'd need to have MANY auras the way I can think of doing it (since I'm not a LUA genie). Basically it would be 1 aura for every stack of debuff - which would have to be duplicated for every person in your raid. Unless there is a magical LUA coder who could do it without each stack needing their own aura (which it likely could be done) I doubt you'll want to do it the way I suggested.

  3. #3
    Get the number of stacks, determine colors based on the stack count, return a formatted string. Something like:
    Code:
    function()
    local debuff = UnitAura("raid1", "Shadowed Soul") -- get the debuff, not the unit is raid1. change for 2-25
    local stacks = Select(7, debuff) || 0 -- get the stack count
    local r,g,b = 255,0,0 -- assign a default color
    if stacks < 6 then -- change color if less than 6
     r,g,b = 0,255,0
    elseif stacks < 12  -- change color if bigger than six but less than 12
     r,g,b = 255,192,0
    end
    return string.format("|c%02x%02x%02x%d|r", r, g, b, a, stacks) -- put together the colorized text to ship back
    end
    You could do it with one aura by building looping over all of the raid units, building a table of name/count, and then building one big-ass string of name/count.
    It's not really better or worse in terms of performance.
    A new UI series for 5.2Steal my old UILearn about WeakAuras • Nobody to raid with right now so no PVE videos.

  4. #4
    Touchy to the rescue!

  5. #5
    Blademaster Bukowskaii's Avatar
    Join Date
    Dec 2012
    Location
    Lubbock, Texas
    Posts
    25
    I'm getting an error [string "return function()..."]:3: unexpected symbol near '|' when trying to import that. How are you importing it?

  6. #6
    Because the import is not for code like that, but a less friendly looking string that is exported from by the addon.
    Such a string will describe amongst other things the grouping, names, and other parts of the aura.

    That up there is only part of the code, and for a single aura for a single member of the raid.

  7. #7
    Blademaster Bukowskaii's Avatar
    Join Date
    Dec 2012
    Location
    Lubbock, Texas
    Posts
    25
    EDIT 5/1/13 @ 10:24 EST: Fixed, the following is WORKING

    alright, got it working. I have a 25 man raid, so I just scan the first 25 players in the raid (I was having issues with the UnitName("raidn") function in a for loop, so I switched to the GetRaidRosterInfo(i) since it uses an index. If you have a 10 player raid, just change the 25 to 10 in the while loop and it'll scan 10 instead of 25.


    Actual Lua Code: New -> Text -> %c -> Code goes in the "Custom Function" box.
    Code:
    function()
        
        local names = {}
        local stacks = {}
        local info = {}
        
        for i = 1,25,1 do
            if select(1,GetRaidRosterInfo(i)) ~= nil        
            then 
                if select(5,GetRaidRosterInfo(i)) == "Death Knight" then
                    r,g,b = 196,30,59
                elseif select(5,GetRaidRosterInfo(i)) == "Druid" then
                    r,g,b = 255,125,10
                elseif select(5,GetRaidRosterInfo(i)) == "Hunter" then
                    r,g,b = 171,212,115
                elseif select(5,GetRaidRosterInfo(i)) == "Mage" then
                    r,g,b = 105,204,240
                elseif select(5,GetRaidRosterInfo(i)) == "Monk" then
                    r,g,b = 85,138,132
                elseif select(5,GetRaidRosterInfo(i)) == "Paladin" then
                    r,g,b = 245,140,186
                elseif select(5,GetRaidRosterInfo(i)) == "Priest" then
                    r,g,b = 255,255,255
                elseif select(5,GetRaidRosterInfo(i)) == "Rogue" then
                    r,g,b = 255,245,105
                elseif select(5,GetRaidRosterInfo(i)) == "Shaman" then
                    r,g,b = 0,112,222
                elseif select(5,GetRaidRosterInfo(i)) == "Warlock" then
                    r,g,b = 148,130,201
                elseif select(5,GetRaidRosterInfo(i)) == "Warrior" then
                    r,g,b = 199,156,110
                end
                
                names[i] = string.format("|cff%02x%02x%02x%s", r, g, b, select(1,GetRaidRosterInfo(i)))
            else  
                r,g,b = 0,0,0
                name = "No Player"
                names[i] = string.format("|cff%02x%02x%02x%s", r, g, b, select(1,GetRaidRosterInfo(i)))
            end 
            
            name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId =  UnitDebuff(select(1,GetRaidRosterInfo(i)),"Shadowed Soul")
            
            if count ~= nil then
                if count < 6 then 
                    r2,g2,b2 = 0,255,0
                elseif count < 10 then
                    r2,g2,b2 = 255,192,0
                else 
                    r2,g2,b2 = 255,0,0
                end 
                stacks[i] = string.format("|cff%02x%02x%02x%d", r2, g2, b2, count)
            else  
                r2,g2,b2 = 15,150,190
                count = 0
                stacks[i] = string.format("|cff%02x%02x%02x%d", r2, g2, b2, count)
            end
            
            info[i] = names[i] .. " " .. stacks[i] .. "\n"
            
            if i == 1 then
                output = info[i]
            else 
                output = output..info[i]
                
            end
        end
        
        return output
        
    end

    Or, here is the WeakAuras string
    Code:
    dSuHraGiuPlrs1OiItrOMfq3IQuTlQsgguCmuXYOspJqQPrs5AqvBdc13OizCiIohIW8Oqr3JQAFePchekLSqIKEiuQmrOu0fPivBerQ(ivHrcLcNKIyLi1ljsLmtks5MqizNuO6NuOWqPkLLsbpfHPcLCvIuvFLiv5TejMlrQO7sKYEj1FPkAWQdtIftr9yOYKHOldAZe8ze1OjjNMsRMivQxdHy2e1THGDd43iz4uilhv9CinDuUovSDcjFhrkJNqCEejRNcLEpuk18Hsv3hcP2VSMJglnbcAcKAcKAS0eiTOs3oa4ywrb1M1eiTOgjRqkSGIW0e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nmy0mTga
    Last edited by Bukowskaii; 2013-05-02 at 02:37 AM. Reason: Fixed with Working Code/String

  8. #8
    Bloodsail Admiral Thundertom's Avatar
    Join Date
    Oct 2009
    Location
    The Netherlands
    Posts
    1,089
    Ninja-ing this thread to ask my own question;

    Can WA show the amount of vengeance I have? So I have a rough idea how good mobs will stick to me when I'm taunting?

    If so, how can I accomplish this? Can I put this in a bar that fills up when I get more vengeance?

    Also, as I am a frequent visitor of this part of the forum, I noticed that a lot of question revolve around WeakAura's. Maybe it's an idea to have a WA sticky? Such as the ASK IT! stickies?

  9. #9
    Quote Originally Posted by Thundertom View Post
    Ninja-ing this thread to ask my own question;

    Can WA show the amount of vengeance I have? So I have a rough idea how good mobs will stick to me when I'm taunting?

    If so, how can I accomplish this? Can I put this in a bar that fills up when I get more vengeance?

    Also, as I am a frequent visitor of this part of the forum, I noticed that a lot of question revolve around WeakAura's. Maybe it's an idea to have a WA sticky? Such as the ASK IT! stickies?
    This is the lua for it:

    Code:
    local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Vengeance")
    if not value then
        value=0
    end

  10. #10
    Bloodsail Admiral Thundertom's Avatar
    Join Date
    Oct 2009
    Location
    The Netherlands
    Posts
    1,089
    Quote Originally Posted by inferior2 View Post
    This is the lua for it:

    Code:
    local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Vengeance")
    if not value then
        value=0
    end
    Ok, I think I can make that work. Thanks!

  11. #11
    Blademaster Bukowskaii's Avatar
    Join Date
    Dec 2012
    Location
    Lubbock, Texas
    Posts
    25
    Alternatively just make a text that triggers on detecting the vengeance buff, would be a lot easier to customize than lua code imo

  12. #12
    Bloodsail Admiral Thundertom's Avatar
    Join Date
    Oct 2009
    Location
    The Netherlands
    Posts
    1,089
    Quote Originally Posted by Bukowskaii View Post
    Alternatively just make a text that triggers on detecting the vengeance buff, would be a lot easier to customize than lua code imo
    I thought the same, but Vengeance isn't a static buff. It's Attack Power buff fluctuates depending on if you're being hit or not. I wanted to get the current amount of AP and translate that into either a bar or a number.

  13. #13
    Quote Originally Posted by Thundertom View Post
    I thought the same, but Vengeance isn't a static buff. It's Attack Power buff fluctuates depending on if you're being hit or not. I wanted to get the current amount of AP and translate that into either a bar or a number.
    Use "Full Scan" option and check the "use tooltip size instead of stacks" at the bottom.

  14. #14
    I use a lot of Weak auras on my shaman and priest both toons' off and main spec. However when I switch from Shadow to disc on my priest I always lag and usually lag completly out of the game. I lag out of Lei chen normal/lfr instantly as he's pulled as Disc, but nothing when I am playing as shadow. If I remove WA after lagging out I come back and theres no lag at all in any spec.
    I've tried to find the trigger to why it's happening but cant find anything.

    Ive been trying to make a WA for Weakened soul on my target of target in disc, but cant find that. Basically I'd like an aura that show me when I can shield the tank currently on my atonement target.

  15. #15
    Bloodsail Admiral Thundertom's Avatar
    Join Date
    Oct 2009
    Location
    The Netherlands
    Posts
    1,089
    Quote Originally Posted by ccKep View Post
    Use "Full Scan" option and check the "use tooltip size instead of stacks" at the bottom.
    You guys are good!

  16. #16
    going into use on my tank

  17. #17
    Quote Originally Posted by soyzan View Post
    Ive been trying to make a WA for Weakened soul on my target of target in disc, but cant find that. Basically I'd like an aura that show me when I can shield the tank currently on my atonement target.
    Trigger: Aura, Weakened Soul, Debuff.
    Unit: Specific Unit: targettarget.

  18. #18
    Thank you Lissa worked like a charm.

    A visual animation and sound when my targets target do not have weakened soul debuff for quick shielding when WS drops off or when tank swopping and I am atonement healing.

    dKZTcaGEfH2fr51evZukfZfIzRu3Ki8nLODsK2l1UrSFfr)urXFvs)gQBtcdLqmyLqdNKoOqESQCmfCoHQfQQ0svKS yPKLl4Wi9uWYKcpx0WiKMQunzsnDvUOuQ6QkQ8mfPUUK2OIQoTeBgsBxkL(mbFvvX0uOVtOAKerNuv1OLIgVuQCjfb 3srPRPeCEs02iuUmQXju2dUBOy4NCCaL(yK)hMKiGkV3RsI3kxJYMC2XrztonKggKnkBPS4guyqBq7Ubum5GYezlTX 0g0LuDtvch9jpnmbvdbwOGjDLQSHYdtmOCgu0Kpp)Sl0q0LnIngVXGyIn9ySygD2rXmSXuT7gQjV(20m9xdb8MD3GI 6(kU7ZNHAYRPk)8xdPk)C3qwicB2sh8z4TPz6UHSqe2SbrM6V9q3Npd03vWK0Dd5rdN7gsCLOn8tooGsFmsKwJjjYh MkpQgOjIiyX5qunqtjyDHIa4krNiTQb1rzybbdA8AIReTB5ZaAHuYMUBiXvI2Wp54ak9XirAnMKiFyQ8OAGMiIGfNd r1anLG1fkcGReDI0QguhLHfemOXRjUs0(RpFgUqrqGdUBOskNbfSIwCWqQYVcA5nhPCgoAqGVJge4ZaHQGt3T0bdFy QCMW6jxeW1TpdAUvffTRuLniz0usm)CTXNH2ndkAYNLoeBuw8LXhJ3yi2YfmqQk6HIGahslDWqrBqCMkNjS2NbQ7g( Wu5mH1tUiGRBd)KJdO0hJ8)WKebu59Evs8w5Au2KZookBYPpdT1shgfvuF2a

  19. #19
    Quote Originally Posted by Bukowskaii View Post
    EDIT 5/1/13 @ 10:24 EST: Fixed, the following is WORKING...
    Unfortunately this does not work if you not in a full raid group!

    You query the debuff off of a nil player; I have fixed it:

    Code:
    function()
        
        local names = {}
        local stacks = {}
        local info = {}
        local unitStringName;
        
        for i = 1,10,1 do
            if select(1,GetRaidRosterInfo(i)) ~= nil then 
                if select(5,GetRaidRosterInfo(i)) == "Death Knight" then
                    r,g,b = 196,30,59
                elseif select(5,GetRaidRosterInfo(i)) == "Druid" then
                    r,g,b = 255,125,10
                elseif select(5,GetRaidRosterInfo(i)) == "Hunter" then
                    r,g,b = 171,212,115
                elseif select(5,GetRaidRosterInfo(i)) == "Mage" then
                    r,g,b = 105,204,240
                elseif select(5,GetRaidRosterInfo(i)) == "Monk" then
                    r,g,b = 85,138,132
                elseif select(5,GetRaidRosterInfo(i)) == "Paladin" then
                    r,g,b = 245,140,186
                elseif select(5,GetRaidRosterInfo(i)) == "Priest" then
                    r,g,b = 255,255,255
                elseif select(5,GetRaidRosterInfo(i)) == "Rogue" then
                    r,g,b = 255,245,105
                elseif select(5,GetRaidRosterInfo(i)) == "Shaman" then
                    r,g,b = 0,112,222
                elseif select(5,GetRaidRosterInfo(i)) == "Warlock" then
                    r,g,b = 148,130,201
                elseif select(5,GetRaidRosterInfo(i)) == "Warrior" then
                    r,g,b = 199,156,110
                end
                
                names[i] = string.format("|cff%02x%02x%02x%s", r, g, b, select(1,GetRaidRosterInfo(i)))
            else  
                r,g,b = 100,100,100
                unitStringName = "No Player"
                names[i] = string.format("|cff%02x%02x%02x%s", r, g, b, name)
            end       
            
            local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId;
            
            if not unitStringName == "No Player" then            
                name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId =  UnitDebuff(select(1,GetRaidRosterInfo(i)),"Shadowed Soul")
                end
                
                if count ~= nil then
                    if count < 6 then 
                        r2,g2,b2 = 0,255,0
                    elseif count < 11 then
                        r2,g2,b2 = 255,266,0
                    elseif count < 16 then
                        r2,g2,b2 = 255,128,0
                    else 
                        r2,g2,b2 = 255,0,0
                    end 
                    stacks[i] = string.format("|cff%02x%02x%02x%d", r2, g2, b2, count)
                else  
                    r2,g2,b2 = 15,150,190
                    count = 0
                    stacks[i] = string.format("|cff%02x%02x%02x%d", r2, g2, b2, count)
                end
                
                info[i] = names[i] .. ": " .. stacks[i] .. "\n"
                
                if i == 1 then
                    output = "Shadowed Soul:\n"..info[i];
                else 
                    output = output..info[i]
                end
            end
            
            return output
            
        end

  20. #20
    Quote Originally Posted by Kasc View Post
    Code:
    -- ... snip ...
                if select(5,GetRaidRosterInfo(i)) == "Death Knight" then
                    r,g,b = 196,30,59
                elseif select(5,GetRaidRosterInfo(i)) == "Druid" then
                    r,g,b = 255,125,10
                elseif select(5,GetRaidRosterInfo(i)) == "Hunter" then
                    r,g,b = 171,212,115
                elseif select(5,GetRaidRosterInfo(i)) == "Mage" then
                    r,g,b = 105,204,240
                elseif select(5,GetRaidRosterInfo(i)) == "Monk" then
                    r,g,b = 85,138,132
                elseif select(5,GetRaidRosterInfo(i)) == "Paladin" then
                    r,g,b = 245,140,186
                elseif select(5,GetRaidRosterInfo(i)) == "Priest" then
                    r,g,b = 255,255,255
                elseif select(5,GetRaidRosterInfo(i)) == "Rogue" then
                    r,g,b = 255,245,105
                elseif select(5,GetRaidRosterInfo(i)) == "Shaman" then
                    r,g,b = 0,112,222
                elseif select(5,GetRaidRosterInfo(i)) == "Warlock" then
                    r,g,b = 148,130,201
                elseif select(5,GetRaidRosterInfo(i)) == "Warrior" then
                    r,g,b = 199,156,110
                end
    -- ... snip ...
    Just something to note regarding performance: You're calling GetRaidRosterInfo and select way more often than you need to, consider this:
    If you're currently iterating a warrior you're actually calling select() and GetRaidRosterInfo() 11 times each.

    You might want to use something like this:
    Code:
                local cls = select(5, GetRaidRosterInfo(i))
                if cls == "Death Knight" then
                    r,g,b = 196,30,59
                elseif cls == "Druid" then
                    r,g,b = 255,125,10
                elseif cls == "Hunter" then
                    r,g,b = 171,212,115
                elseif cls == "Mage" then
                    r,g,b = 105,204,240
                elseif cls == "Monk" then
                    r,g,b = 85,138,132
                elseif cls == "Paladin" then
                    r,g,b = 245,140,186
                elseif cls == "Priest" then
                    r,g,b = 255,255,255
                elseif cls == "Rogue" then
                    r,g,b = 255,245,105
                elseif cls == "Shaman" then
                    r,g,b = 0,112,222
                elseif cls == "Warlock" then
                    r,g,b = 148,130,201
                elseif cls == "Warrior" then
                    r,g,b = 199,156,110
                end
    Or, even better, use the blizzard color table:
    Code:
    local cls = select(6, GetRaidRosterInfo(i))
    local col = RAID_CLASS_COLORS[cls]
    
    
    if not col then
        -- error handling 
    end
    
    
    local r,g,b = col.r, col.g, col.b
    Also: You might want to use the 6th return value of GetRaidRosterInfo since the 5th is localized.
    Last edited by ccKep; 2013-05-09 at 01:16 PM.

Posting Permissions

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