1. #1

    Weakauras: Text changes color conditionally

    Hello folks.

    I'm trying to do up a text aura in weakauras that will change color when I need to taunt off my cotank. I've got everything working about the aura except the color change. I dug up this old thread via google, but despite the function not throwing any errors, I can't figure out why it isn't changing color.

    I have the main color set to white and the "animation" color set to red, with the following under "Custom Function":
    Code:
    function(r1,g1,b1,a1,r2,g2,b2,a2)
        local status = UnitThreatSituation("player", "target")
        if status==0 then return r1,g1,b1,a1 else return r2,g2,b2,a2 end
    end
    Probably-irrelevant details:
    The aura itself triggers when it checks my cotank for a tank-swap mechanic debuff (Static Burst is what I'm using to start). It displays a small line of text stating he has Static Burst, with a %c that displays "TAUNT!" if I'm in threat status 0 (not tanking + lower on aggro table). This part works fine, but I am using nearly-identical code to change the color, and it's not working. I'm sure I'm missing something simple and would appreciate any help.

    For the sake of testing whether my code even works in the first place, I set up this one to tool around Vale of Eternal Blossoms taunting random unfortunate critters and beasts. If it works, it should always be either a red 3 or a white ?.

    Code:
    dGZ8caGEvbTlHITPKmBL63q(gqomj7eK2R0UjSFrJsvQ)sjmoHQlR48eLbRYWrOdQKItbGJHOZbqluvvlvjvwSQklhQfbupLQhdQNl40KAQizYkX0r9qHsUQQqpJOY1PyJuI(Sq2mi2UQIpQKsZcPMgG(UsQAzezyusJMs14vLCjvbUfrvxtvP7PkALuk)uOu3gbxYsvNq9L6lLQoeKGD9dNcDv86l6aXTsg18IR)a46WMaJiqnV46qmcywJeVbiTLxE5L3gbR25fyfBc59mVhfAMYoEuSRzJI1iXBWe3kzdgmDEGzfoAyWaK2YlV8YdpSblYlWk2esBJyPUsOjOynsuQ6euArPQZYio1HnbgrOUjmwaJ2iC)xhgTr4)fQ16WOncV2c1ADy0gHT0iGRJh2Gf5bXiGzns8gtshrs)JKwrsJLOJKO)jrRKaiTLxE5L3gbR25fyfBc59mVhfAMYoEuSRzJI1iXBWe3kzdgmDEGzfoAyWaK2YlV8YtdjVaRyt45t5YJTpI8WdBWI8Ws0rs0)KOvs5n7WKhEydwKhMKoIK(hjTImVrSK2gXsDy0gHxtHswhgTr41vOK1HrBeMsgXPoSjWicLlxNX6OObxQ6SmIt9aRytO(8zeC9yHelAwJeH6MWyHrO5(VUjmwO26pt)x3iMpJGRRmmQCD8ePrckzeN688IRVE9cBVw(DvCjjqsYjhqjGacyCGfI8abvxyiqH1rrdouOK11l15jW1Tp6i7CTeiO4FTc67kqGIljbiOvfI8axv)vSHajmCHkp5xR13i1sPQJr7Pu1jy2SUuLlxUC9qDYyagdOyaS(NcLeOvRLBba
    Thanks in advance.

  2. #2
    Create two WeakAuras, one for red and one for white. It's the easiest and simplest solutions.

    Example:

    First WA: Off tank doesn't have debuff to taunt - Text White
    Second WA: Off tank has debuff to taunt - Text Red

    Unless I'm missing something else that you are trying to do, this should work. This is what I would do.

  3. #3
    Thanks, but that's not really what I want.

    Other tank has no debuff: no aura
    Other tank has debuff but I have aggro on my target: white aura
    Other tank has debuff but I don't have aggro on my target: red aura

    If I do this without lua custom scripts, it's five auras per debuff I want to watch (no debuff, debuff plus threat condition 0, 1, 2, or 3). So no. I want to get this working, but thanks for the suggestion.

  4. #4
    Under the animation duration, did you set a time? If you leave that blank it won't change color.

  5. #5
    Quote Originally Posted by piefayth View Post
    Under the animation duration, did you set a time? If you leave that blank it won't change color.
    This was the problem. D'oh. Thank you!

    ---------- Post added 2013-04-12 at 04:58 PM ----------

    Follow-up question: Is there a way to import the values from your WA trigger to compare them in a custom lua function?

    For example: Show aura if co-tank has Static Wound. Custom lua function grabs stack count from YOUR Static Wound debuff and compares it to THEIR Static Wound debuff, then returns something depending on whether yours > theirs or vice versa.

    I realize I could just put the player's name directly into the custom lua, but it would be nice to pull from the settings of the aura itself. Something like:
    Code:
    function()
        local _,_,_,theircount=UnitBuff("weakauratriggertarget","Static Wound")
        local name,_,_,mycount=UnitBuff("player,"Static Wound")
        if name ~= nil then
            if mycount < theircount then return "TAUNT!" else return "" end
        end
        return "TAUNT!"
    end
    Last edited by Eleri; 2013-04-13 at 01:03 AM.

  6. #6
    Have a look at the WeakAuras variable

    ie:
    Code:
    local name = GetUnitName(WeakAuras.CurrentUnit)
    A new UI series for 5.2Steal my old UILearn about WeakAuras • Nobody to raid with right now so no PVE videos.

  7. #7
    You're awesome, thank you. This is exactly what I wanted.

Posting Permissions

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