#Custom Code. Stacks that don't recognise 0

12 messages · Page 1 of 1 (latest)

split palm
#

Hi everyone,

I am trying to make a counter that can count how many people are standing in my resto druid effloresence. And I have a piece of code that shows that correctly.

But I would like to to add conditions to add a border glow if it is less than 3. And it almost works. If there are 1 or 2 people in the effloresence the border shows up correctly but not if there are 0 people standing in it. So I am guessing that the "stacks" from this lua function is not returning 0 even if there are 0. Because 0 is less than 3. Can anyone see what might be wrong?

function(s,e,arg2,,,source,,,,,,,_,spellID)
if spellID == 81269 and source == WeakAuras.myGUID then
local t = GetTime()
if not s[""] or t > s[""].hitTime + 0.3 then
s[""] = {
show = true,
hitTime = t,
stacks = 0,
count = 0,
}
end
s[""].stacks = s[""].stacks + 1
s[""].count = s[""].stacks
s[""].duration = 2
s[""].autoHide = true
s[""].changed = true
return true

end

end

Custom Valriables
{stacks = true}

shadow basalt
#

%s automatically hides zeros, you want to use %stacks as your text replacement

split palm
#

@shadow basalt Thank you so much for your fast reply! Oh so what do I change? Sorry I am just not good with code. I am just copying other people's codes. I dont see any where it says %s. Is it all the ones where it says s[""] that needs to be changed to stacks[""]?

shadow basalt
#

the code is fine, change the text subelement

#

from %s to %stacks

split palm
#

function()
if aura_env.states[1].show then
return aura_env.states[2].show and aura_env.states[2].stacks or 0
end
end

#

This one?

shadow basalt
#

no, the aura seems to be more complicated than expected

split palm
#

dunno if this helps

#

Solved it! Actually just had to add that if Trigger 2 is false then it "counts as 0"