1. #1
    Deleted

    WeakAura Custom Duration doesn't update on target switch

    I am trying to make a progress bar that's always displays and is full dependent on the number of stacks of my Lacerate on the target. What I currently have works fine except from when I first select a target.

    For the trigger I have:
    Type: Custom
    Event Type: Status
    Check On: Event(s): UNIT_AURA, PLAYER_TARGET_CHANGED

    Custom Trigger:
    Code:
    function()
        return true
    end
    Duration Info:
    Code:
    function()
        local stacks = select(4, UnitDebuff("target", "Lacerate", nil, "PLAYER"))
        
        if stacks >= 1 then
            return 1, 1, true
        else
            return 0, 1, true
        end
    end
    I have 3 identical auras just for different amounts of stacks. I don't know if this is the issue but when I test UnitDebuff using /script command it prints nothing for when the target does not have the debuff.

    Code:
    /script print(UnitDebuff("target", "Lacerate", nil, "PLAYER"))
    There complete aura is below:
    Code:
    deKdgaGisrJcuvNcuPzPQ0TusTlsHgMcDmsAzGYZiX0KW1uITPaFdQmoOQZHk5EsuSpGkDqKslub9qsPMiQOlcLAJkjFeuLrcuLtIk1kv0mrkUjqvTtq(PevdLuGLcf9urtfrxvvXzbQyVu)fOmyihwvwms1JryYOQlRYMjvFgiJgv40k1RHsMnsUTQQDd43sA4sKLJYZLY0fUUuTDsjFxIsJhuX5HcRNuq7NyRAsN)o5DYBsNWPCD92fgATAHtmkxxVDHHwRIF0j9kJ)yAxPQmtAivdnAiygA0qkgA0qfgA0Ht9kqSI6bQ5S8pK0Wne2oP)yAxPQmtAiyE1GfLIbkf4wuku4APy06RxuC4KQ(4nPZE7ad406yMUZ4rDaHjD(3PITjD4Wjb1R1mPZ2gae15Ktm)WnNo)7uX2Ko5eZpCZPh6WHt(TU(MOtfyysN)DQyBshoCYEeNjD(3PITjD4WzVDG1kDeEOZwPJWKoBBaquNHuC(3PITjnemp0qkEOdho7TdmcQxR5HozvQZKo)7uX2KoC4Wj7aTRaKyu6C(6Sh9hZzCWj6SZj4Vb2)pQDlCsVY4pw566TlmemN0Rm(JXnq7cdP6KELXFSHpcS4z1soXMsRpClOHupaSC2bc2geOJzsNe9wu)Dktz6Wj)UvI6Hb5bNGMtpCkiNbBdc0XmPtG3)1mPHuDsZJ4yV4C4S3oTRDGWdDYF0766Kyu6CcE0Ij4V6dnodmkDoj6TO(7KO3I6pyCS5pNe9wu)Ds0Br9hSaJsNZw8IEZjrTdeLx6yVOYCcULXjrTdeovDs0Br9pJhbwnNYuMoj6TO(ZzN9IDfWPEhGi2va4dxzkibjibrvjEucQfpcSAcQmcQDuhra)IVc6dWo48O311HVMXJb6cn)kinP5rCSxCA(vqaBQVcstnGgAbhSXut4cxzkibjibjtbjibjOTUGAXJaRMGa3Yiiyck44aKPGeKGeKGeKGee7IodqqQFfK6xbfS(jtbjibjOJQDYuqcsqcsqcsqcIDrNbiOXVcs9RGcw)KPGeKGe0bWlZdGxMYuMY0jrVf1FN6DaIyxbGpCLPGeKGee7IodqqbRFY8a4LPmLPmLPmLPmLPmLPmLPmLPmLPmLPmDsWXrGLZtRdiCEADarZ5hiUjbJ2pys7xbPb0ql4GnMGrslMWdBsW0g8OfcEyZPZoWoCgpgOlC4K(JalEwTK2vQkZKgs1RwwWpYLIQYimUuWTuG36RxkmemVAzb)ixkQkJW4sb3sbERVEPWqkE1Yc(rUuuvgHXLcULc8wF9sHHkmKQdNCCBqCegsfMt6vg)X8qN0Rm(JHnpOZj2uA9HBbbpQAzhwz8hZ5JNFh7kWJcSGTbb6ynt6Wj9kJ)y5wdpdP6eO)tY2GaDSMHuDUjQaMUZnVt41Fm(9dqq08io2lobbZzz38bhgAWaN0FeybIv7a8AxPQmtAivVcNsbUXc84hvWpaNkmCwF9YadbZRWPuGBSap(rf8dWPcdN1xVmWqkEfoLcCJf4XpQGFaovy4S(6LbgQWqQoCYVBLOEyqEWjWCdIJWPGC4S5eMgv14OgvCQLHulGP6Wga
    Last edited by mmoc9bf5730c91; 2015-05-20 at 01:23 PM.

  2. #2
    Deleted
    I'm not 100% sure what you mean with
    [...]works fine except from when I first select a target[...]
    Being more specific with what should happen and what's happening instead might have been more useful.

    That said, I don't have a Feral Druid to test this, but importing the WA it seems you need to change
    Code:
    if stacks >= 1 then
    to
    Code:
    if stacks and stacks >= 1 then
    It's for the reason you mentioned above, that UnitDebuff return nil if the debuff isn't present. So we need to check that stacks holds a value.
    I guess you don't have Lua errors enabled since the WA is throwing this specific error. I use Bugsack and Buggrabber to suppress the possible spam.

    Hope this little change fixes the WA for you.

  3. #3
    Deleted
    Quote Originally Posted by lleaf View Post
    I'm not 100% sure what you mean with

    Being more specific with what should happen and what's happening instead might have been more useful.
    When I select a target who does not have the debuff, the aura does not display. I should see the empty progress bar at this point. When I then lacerate the target the aura displays. If I then switch targets to a target without Lacerate, the progress bar stays visible but is full instead of visible and empty.

    Quote Originally Posted by lleaf View Post
    That said, I don't have a Feral Druid to test this, but importing the WA it seems you need to change
    Code:
    if stacks >= 1 then
    to
    Code:
    if stacks and stacks >= 1 then
    It's for the reason you mentioned above, that UnitDebuff return nil if the debuff isn't present. So we need to check that stacks holds a value.
    I guess you don't have Lua errors enabled since the WA is throwing this specific error. I use Bugsack and Buggrabber to suppress the possible spam.

    Hope this little change fixes the WA for you.
    I tried the your suggestion and I still get the same behaviour. I also tried replacing the stacks declaration to:

    Code:
    local stack = select(4, UnitDebuff("target", "Lacerate", nil, "PLAYER")) or 0
    As testing that I would get 0 for when the debuff was not present or the number of stacks if it was present but this also does not work.

    - - - Updated - - -

    Okay - that did work, I hadn't update the other two similar auras which was stopping the first one from behaving properly.... Thanks!

  4. #4
    Deleted
    Nice to hear, and your solution is even better.

Posting Permissions

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