Page 63 of 111 FirstFirst ... 1353616263646573 ... LastLast
Results 621 to 630 of 1109

Thread: WeakAuras Tutoring Thread

  1. #621

    Default

    The chat frame is now consistently reappearing a few seconds after combat. Would it help if I had a set number of frames, so it never needed to check? I only show general, Combat Logs, Messages (one channel for PMs, battle.net and real ID), Trade, and General (the channel)

  2. #622

    Default

    Is there a way I can dynamically change the color of text in my Display trigger?

    Example:

    Code:
    function()
        local power = UnitPower("player" , 8); -- Negative is lunar, positive is solar
       
        local direction = GetEclipseDirection() -- returns "sun, "moon" or "none"
       
        local output = "Energy: ".. power .."\nDirection: ".. direction -- old return output, ignore
       
        if power < 0 then
            return "Lunar: " .. (power*-1) .. "\nDirection: " .. direction
        elseif power > 0 then
            return "Solar: " .. power .. "\nDirection: " .. direction
        else
            return "Zero Energy!"
        end
    end


    I want to change the outputted text colors depending on the state its in. (I want the words Lunar to be blue and Solar to be orange, while the numbers are yellow etc.)
    Last edited by Krazyito; 09-20-2014 at 06:55 PM.

  3. #623

    Default

    Ended up doing something differnet. This works well.

    Spoiler



    Which also answer's my question I suppose. Just make new auras to change the color of stuff I want and hide the ones I'm not worried about.
    Last edited by Krazyito; 09-21-2014 at 02:50 AM.

  4. #624

    Default

    Can't seem to find an event that triggers when a player in my raid dies. (only when I die).

    Is there a special way of doing this so I don't check every frame?

  5. #625

    Default Sacred Shield

    Hi there,
    I've created a Weak Aura for Sacred Shield based on SpellID (since the absorb effect is also called Sacred Shield and I only want to track the main buff, SpellID 20925). Here it is:
    Code:
    dWZreaGlvvSnQeTpskmtskAUujz2u18jPk3KKkDyv52c15rr7ujSxKDty)sJsa)fs)gIltzOuPQbdgojoOQIoLaDmvLCouOfIcwgk1IPsLLtQfjepv0JvXZr1efstvjnzLA6konrxLkfpJKsUUknpsQ4KKKnlOTtsP(ivcZckttvL(ovs9zuYWuv1OHkJhQYLiPQULQsDnOQUNs0kPIxRQWpPsPPVOvkJPCt5MwP8kgTKflttRuEU8bjMYWR4mserGG1PqHcf8iNNVakgkgkgkgkgkMHNIuBCmumumumUI59QIwyzb3iKdd3WWaru8pMMocwHi57OTDHeN087ibRtHcfkidlWvmVxv0clxwG9FgzJFHNyxiGHNIuB8cFxWf2SkJTabdwqnk4YcdotuNcfkuOqHcf02C1IcJ(A1PqHcfmXUofkuOGmSaxX8Evrlu1Bzb2)zKn(fgCMOofkuOqHcfkOT5Qffg91QtHcfkyIDDkuOqbTnxTOq4ZZT6yInnuoAjlwMMwPCyQyuEU8bjMYZLpiX58oFWPKYZLpiXrV63ireuwN6q55YhKykdVIZirebcwNcfkuWJCE(cOyOyOyOyOyOygEksTXXqXqXqX4kM3RkAHLfCJqomCddderX)yA6iyfIKVJ22fsCsZVJeSofkuOGmSaxX8EvrlSCzb2)zKn(fEIDHagEksTXl8DbxyZQm2cemyb1PGllm4mrDkuOqHcfkuqBZvlkm6RvNcfkuWe76uOqHcABUArHWNNB1XeBkp4SZhuEv2VXO8C5dsm6WuXOKpV5YP8C5dsmko52OCKX2MgkXzsw4gAXV4tPh5TPvkVCd94FCoXaLAeVrRugF9JKwPHgkp(hNtRuYLcwEJs3)PA(zuvlOHgk3sUI)XmN35doLQ)HsTXsIiwzQyukpickLBkZ3rB7eN08BkXZTHHCBOfS)tPRL7bhT4x8PuCJx1swSmnNw8fLmDByi3gAX3mQwu(eY43ire0kLXpPGwPCyQyuQOnUnuQOnUnu6oKR4y0qdLBjxX)yQ6GiOuLymD47yUs1brWD1NUt6Ldtu3)8VTuGYG34CBRUMylfSO8GG43iUwqmqdLCkz)Z)Fy8h2uQ20IV(L9FAica
    The Weak Aura is hidden until there is 6 seconds remaining on the Sacred Shield buff, then it appears and bounces irritatingly to remind the user to refresh the buff. That all works correctly.

    What I'd like to do is for the aura to show a "cooldown" showing how many seconds remain on the buff. Normally this would be easy, but it seems because I'm using custom triggers/untriggers, I need to also set a custom duration and I don't have any idea how to do that. I tried a function in the "Custom Duration Info" like so:
    PHP Code:
    function()
        
    local _,_,_,_,_,_,expires,_,_,_,spellID UnitBuff("player""Sacred Shield")
        if 
    spellID == 20925 then
            local duration 
    expires GetTime()
            return 
    duration
        end
        
    return false
    end 
    But either that wasn't working correctly, or I couldn't work out how to transfer that returned duration as a cooldown/sweep timer on the icon for my Aura. Any help would be greatly appreciated!

  6. #626

    Default

    Quote Originally Posted by Soralin View Post
    Hi there,
    I've created a Weak Aura for Sacred Shield based on SpellID (since the absorb effect is also called Sacred Shield and I only want to track the main buff, SpellID 20925). Here it is:
    Code:
    dWZreaGlvvSnQeTpskmtskAUujz2u18jPk3KKkDyv52c15rr7ujSxKDty)sJsa)fs)gIltzOuPQbdgojoOQIoLaDmvLCouOfIcwgk1IPsLLtQfjepv0JvXZr1efstvjnzLA6konrxLkfpJKsUUknpsQ4KKKnlOTtsP(ivcZckttvL(ovs9zuYWuv1OHkJhQYLiPQULQsDnOQUNs0kPIxRQWpPsPPVOvkJPCt5MwP8kgTKflttRuEU8bjMYWR4mserGG1PqHcf8iNNVakgkgkgkgkgkMHNIuBCmumumumUI59QIwyzb3iKdd3WWaru8pMMocwHi57OTDHeN087ibRtHcfkidlWvmVxv0clxwG9FgzJFHNyxiGHNIuB8cFxWf2SkJTabdwqnk4YcdotuNcfkuOqHcf02C1IcJ(A1PqHcfmXUofkuOGmSaxX8Evrlu1Bzb2)zKn(fgCMOofkuOqHcfkOT5Qffg91QtHcfkyIDDkuOqbTnxTOq4ZZT6yInnuoAjlwMMwPCyQyuEU8bjMYZLpiX58oFWPKYZLpiXrV63ireuwN6q55YhKykdVIZirebcwNcfkuWJCE(cOyOyOyOyOyOygEksTXXqXqXqX4kM3RkAHLfCJqomCddderX)yA6iyfIKVJ22fsCsZVJeSofkuOGmSaxX8EvrlSCzb2)zKn(fEIDHagEksTXl8DbxyZQm2cemyb1PGllm4mrDkuOqHcfkuqBZvlkm6RvNcfkuWe76uOqHcABUArHWNNB1XeBkp4SZhuEv2VXO8C5dsm6WuXOKpV5YP8C5dsmko52OCKX2MgkXzsw4gAXV4tPh5TPvkVCd94FCoXaLAeVrRugF9JKwPHgkp(hNtRuYLcwEJs3)PA(zuvlOHgk3sUI)XmN35doLQ)HsTXsIiwzQyukpickLBkZ3rB7eN08BkXZTHHCBOfS)tPRL7bhT4x8PuCJx1swSmnNw8fLmDByi3gAX3mQwu(eY43ire0kLXpPGwPCyQyuQOnUnuQOnUnu6oKR4y0qdLBjxX)yQ6GiOuLymD47yUs1brWD1NUt6Ldtu3)8VTuGYG34CBRUMylfSO8GG43iUwqmqdLCkz)Z)Fy8h2uQ20IV(L9FAica
    The Weak Aura is hidden until there is 6 seconds remaining on the Sacred Shield buff, then it appears and bounces irritatingly to remind the user to refresh the buff. That all works correctly.

    What I'd like to do is for the aura to show a "cooldown" showing how many seconds remain on the buff. Normally this would be easy, but it seems because I'm using custom triggers/untriggers, I need to also set a custom duration and I don't have any idea how to do that. I tried a function in the "Custom Duration Info" like so:
    PHP Code:
    function()
        
    local _,_,_,_,_,_,expires,_,_,_,spellID UnitBuff("player""Sacred Shield")
        if 
    spellID == 20925 then
            local duration 
    expires GetTime()
            return 
    duration
        end
        
    return false
    end 
    But either that wasn't working correctly, or I couldn't work out how to transfer that returned duration as a cooldown/sweep timer on the icon for my Aura. Any help would be greatly appreciated!
    You can find much more detail about custom duration functions in this post, but the short answer is you need your function to return two values: Duration and ExpirationTime

    You already have duration in your example, so just add the expires value in there and you'll be good to go: return duration, expires

  7. #627

    Default

    Quote Originally Posted by Kulldam View Post
    You can find much more detail about custom duration functions in this post, but the short answer is you need your function to return two values: Duration and ExpirationTime

    You already have duration in your example, so just add the expires value in there and you'll be good to go: return duration, expires
    Thanks for the reply! I did see the post you linked when I searched, but I didn't make the connection between the duration function requiring two return values. Doh! I'm truly amazed at how powerful an addon WeakAuras is - but equally amazed at how little there is in the way of organised/centralised resources for it. This thread has been a godsend, thankyou for your time and effort!

  8. #628

    Default

    Hello, in the last few days I've started trying to use custom triggers to make more complex icons. I have run into several problems but will use my most recent project for tutoring material. I wanted to make a group containing 4 icons all pertaining to the fire mage spell "Combustion". The four Icons being "Combustion Icon", "Combustion CD", "Combustion Buff", "Combustion Glow".

    1.Combustion Icon

    Spoiler




    2.Combustion CD

    Spoiler




    3. Combustion Buff

    Spoiler



    4.Combustion Glow

    Spoiler



    For the most part I would greatly appreciate you if you could at least cover "Combustion CD" since that is the one that I want resolved the most . PLEASE! and Thank you!
    Last edited by mendelssohn; 10-21-2014 at 08:19 AM. Reason: Updates on Situation and Clarification

  9. #629

    Default

    Hi and thank you for the great efforts.

    I'm looking for a way to modify display object directly in trigger function. I found that a WA display object can be referred as WeakAuras.regions[id]["region"], where id is a ID string created from display's name. Now we can do
    WeakAuras.regions.MyDisp.region.texture:SetTexture (TexurePath)
    or something.

    But this will not work if we change display's name.
    So my question is: Is there any way to refer to actual display object(textures, texts, bars etc) from custom trigger function?


    Add:

    This is what I want to do. Sets texture path by aura remaining duration.
    Code:
    function()
    
    local ST, WA, id, now = GetSpellInfo(168811), WeakAuras, "SniperTraining", GetTime()
    local obj, modify
    if WA.regions and WA.regions[id] and WA.regions[id]["region"] then
    	obj = WA.regions[id]["region"]
    end
    if WA.regionTypes and WA.regionTypes.texture and WA.regionTypes.texture.modify then
    	modify = WA.regionTypes.texture.modify
    end
    local anchor, data = select(2,obj:GetPoint()), WA.GetData(id)
    
    local name, _, _, _, _, _, expires = UnitAura("player", ST)
    if name then
    	if expires == 0 or ((expires - now) > 4) then
    		data.color = {1,1,1,0.75}
    		data.texture = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Auras\\Aura78"
    	elseif ((expires - now) > 3) then
    		data.color = {1,1,0,0.75}
    		data.texture = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Auras\\Aura27"
    	else
    		data.color = {1,1,1,0.75}
    		data.texture = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Auras\\Aura138"
    	end
    else
    	data.color = {1,1,1,0.75}
    	data.texture = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Auras\\Aura118"
    end
    	
    modify(anchor, obj, data)
    return true
    
    end
    This code works fine, but I need to set local id = "SniperTraining" to match display' ID.
    Somebody knows more elegant way?
    Last edited by Sceone; 10-22-2014 at 05:35 AM.

  10. #630

    Default

    Hi Kulldam,

    After much internet searching this thread has been a god send for consolidated information on Custom Weak auras and lua training. I have a semi challenging question I was hoping you could help me with. I want to dynamically track a debuff that could be on any raid member(one at a time). The *stats* of this debuff I want to track are (how far away the player it's on is(yrds), how many stacks it has, duration left, and possibly a text change based on if its closer/further than a value) Is this possible? Could you point me in the right direction for framework/structure? Whats the best way to scan all debuffs going out effectively?

    Thanks in advance for your advice, even if you point me towards further reading.

Tags for this Thread

Posting Permissions

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