Hi y'all, I'm trying to create a WeakAura for Rogue Poisons and the talent Leeching Poison
For some reason Leeching Poison drops when you log out, the only way to get it back is to reapply your Lethal Poison. I'm creating a WeakAura that creates a clickable Leeching Poison icon when Leeching Poison is missing AND a Lethal Poison is active. It currently looks like this:
All Triggers
Dynamic information from Trigger 1
- Trigger 1 - Aura, Player, Buff, SpellID 108211 (Leeching Poison), Show on Aura(s) Missing
- Trigger 2 - Aura, Player, Buff, [SpellID 315584 (Instant Poison), SpellID 8679 (Wound Poison), Show on Aura(s) Found
So far, this works. If Leeching Poison is missing while Instant/Wound Poison is found - the trigger triggers. Ok, good.
Now for the... trickier part, I want the Leeching Poison Icon to be clickable (I have another WA that applies missing Poisons which is clickable and works just fine!):
Actions - On Init - Custom:
if not aura_env.clickableFrame then
local r = aura_env.region
aura_env.clickableFrame = CreateFrame("Button", "ConsumeButton", r, "SecureActionButtonTemplate")
end
aura_env.clickableFrame:SetAllPoints()
aura_env.clickableFrame:RegisterForClicks("LeftButtonDown", "LeftButtonUp")
aura_env.clickableFrame:SetAttribute("type", "macro")
ViragDevTool:AddData(aura_env, "Leeching WA") -- Debugging
local letahlPoison = aura_env.states[2].name -- shouldn't aura_env.states[2] be the second trigger?
aura_env.clickableFrame:SetAttribute("macrotext", "/cast " .. lethalPoison)
aura_env.states[2].name exists when debugging using ViragDevTool but during the actual trigger of the WA I get the following:
13x Lua error in aura 'Rogue-Buffs_Leeching-Poison_Outlaw': init
WeakAuras Version: 5.2.0
[string "return function() if not aura_env.clickable..."]:11: attempt to index field 'states' (a nil value)
attempt to index field 'states' (a nil value)
but, the states, and even states[2] shows up in the ViragDevTools:
What am I missing?
Thanks!