WeakAuras

WeakAuras

206M Downloads

Condition Not Working: Run Custom Code (SetIcon)

klaxce opened this issue ยท 3 comments

commented

Describe the bug
I expected to be able to change the icon to the designated icon when the current trigger ability has 0 stacks, via condition.

Do you have an error log of what happened?
No errors reported.

To Reproduce
Load this WA https://wago.io/wlyFpRYBu (posted below) or use any ability with charges as your "Cooldown Progress (Spell)" trigger, and then make a condition "If Trigger 1 Stacks = 0 Then Run Custom Code aura_env.region:SetIcon(107428)".

Then spam the trigger ability's keybind as the ability is coming off cooldown from 0 stacks and is about to gain 1 stack.

The icon won't have changed.

Waiting until after the charge is gained and then clicking the keybind will show the expected icon.

Did you try having WeakAuras as the only enabled addon and everything else (especially something like ElvUI) disabled?
Yes, and asakawa tested it with me and got the same result.

Which version of WeakAuras are you using?
2.11.3

Was it working in a previous version? If yes, which was the last good one?
I don't know

Additional context
asakawa from the WA Discord told me to submit a bug report for this issue. He wrote this test version of the WA to make sure it was simple and consistent.

Example WA linked above:
!nw1xZjUnq8pnDMKhkbtOxBVzUhceZvUHAOiN256dcKTLT1eHKRKmeYd8zV7kBZ)AURzggj8QDx9B3F7UIgqJPKnusgLyPKb9cc6Dp(fiD)88Cl3rJ6dc4wMR2WCCAcL44V4cwOfkhLmomkoCjLWuPLAZedBdpEFfNsiJxgggHhi2WCcTYFtmHF35vrPvWAg6x48vncT8uTkZsbFBDmJ79REUqjSLVB9blEMZREWwXtDlrDWyZYL5xfA1gjLu6Cv2pE3D7yf6Ec9D7K7NuT8RJQVlGss1AzMENkgsmHkwIKN59LtK(8(hBbWXm3en69jgXRhw)h1Sm4y2H1XXOFKAdearb(Fd8R37xhIRGzVCgRui17qVI7nj9KANtRMVLBKS9NWvywbVj42ahrjb963dSNv7aoBEfIolCTUgaoymaqGO2WrConIm9XWt(Io6SWGiELd4CyRHxL4k5IIsaQFyiAUkxuC6sc6YtG72jYCLnQHHY4))SG3dVjmRfqP8)m9lr)Tojq)t)vxL5vqlT260Bq(6PQmSSMu3UdQXnkM8p5glYArbabB4fW)BYXciuAJ3ZIb)3xMsyYQsgcyYRA9gpJ51Is(Hk4(S8tbBINm0xKBNizfqp58NINnncISCS3I4WQfVt9448B(BvtPYeDmCKVFpTKN(m(hnGJp9jWfgrrbuyGUDlZiWOcvJzk4wuKSg(UpM5bHkuyNVQm6kUXTVlLMQZ4Dwe3jeJodBfxTTxtM8JeUBkGSB(m3rQ4sjYe1g(nb9)5Hd(LBV13Fcu)f3qlRJjSJ3WBxK0VX(7)V2pOXEhQ2LWVT(gQgRogbJ8(XDwNX3R0SjbDHF665bo3I1wq7N1lvQz(PS40h)KXAPt4BpWbFyn01ctLmR9APGCSGFChjFyDBM9W6r1fhz2t8vTQJSHpk4kUrKsk17Md10wy)b5o2E)40Z0dQvxXsSAtYVJ07i8bHK688MgIFlC2IjpnRrTlD5iS1Hj9uCeu(sjl1syAQc(F7eh0i7XZhDAGnmMcGuDcFl0GVWWZfVaVQSiC2mFwR1GOG()AW9d(EXceZc4IQGrI4Wp8c9sG7Y7Bm91WzhwVWOlmCR9W6B8G(2UhtG3IC12taIaHpcOvJFGeVIe)WY4wynnRlYuTU33A75kwQtSLh3Kz95YOFmOF3jn9OqvIW14HUhap)Xn3zZ)ExZjh8wdt2EC6gQ2wyF4aiDJVUn9ryV71n4u6)(

commented

Replacing the code with print("HERE") shows that is correctly run whenever roll has zero charges for me. As to setting the icon via that method, that's not supported.

commented

i can't replicate

commented

I encouraged Klaxce to make this and was able to replicate the issue.
However on reflection I think it's actually a case of working as intended, even if it's not what is expected/wanted.

Basically the state of the Aura never changes from stacks being equal to 0, so the state can't register the change to stacks = 0 to fire the custom code. However the Aura's overall state is updated, including the icon to whatever the dynamic info is providing.

We see a few cases where Run Custom Code doesn't work as people expect and this is definitely one.