#first tsu having trouble reading cleu event

144 messages · Page 1 of 1 (latest)

dense wraith
#

hello all, trying to put together my first tsu here as a tricks of the trade tracker. right now all i'm trying to get a tricks icon + name for each rogue in the party, then when they cast tricks add a 30s countdown, to track their cooldown
https://wago.io/ZHqf6K2_Z
so far it successfully iterates the group and grabs all the rogues and gives them an icon - great
when casting the desired spell, the subevent seems to trigger fine - print functions return exactly what i'd expect, but the %p progress text is not being updated at all. changing the initialization duration and expiration to arbitrary numbers produces expected results, so i'm at a loss as to why i'm getting nothing out of the sub event firing
help!

function(allstates, event, timestamp, subEvent, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellId, ...)
    
    if event == "GROUP_ROSTER_UPDATE" then
        --TODO: purge if no longer in party
        
        for unit in WA_IterateGroupMembers() do
            local className, classFilename, classID = UnitClass(unit)
            if classFilename == "ROGUE" then
                local name = UnitName(unit)
                
                allstates[name] = {
                    show = true,
                    changed = true,
                    progressType = "timed",
                    duration = 0,
                    expirationTime = 0,
                    name = name,
                    autoHide = false,
                    
                }
                
            end
        end
    end
    
    if subEvent == "SPELL_AURA_APPLIED" then
        if spellId == "59628" then
            allstates[sourceName].duration = 30
            allstates[sourceName].expirationTime = GetTime() + 30
            allstates[sourceName].changed = true
        end
    end
    return true
end

Wago.io is a database of sharable World of Warcraft addon elements

real sigil
#

!bugsack

twilit glacierBOT
real sigil
#

Also try to return true only when something actually changed returning true on every single CLEU can be quite heavy

#

Also check if it really goes there with some print checks

#

Personally I would use the guid as key, not the name

cyan cedar
#

why do you use AURA_APPLIED instead of CAST_SUCCESS?

dense wraith
#

tricks cast first applies a 30s buff to the rogue, does not go on cooldown, but then when you attack a mob is starts the real meat of the ability, applying a new threat transfer buff to you and a new damage buff to your target

#

ie. it goes on cooldown on aura applied

#

or i guess if the "preaura" falls off without ever activating

#

hmmm

#
if subEvent == "SPELL_AURA_APPLIED" then --and maybe if aura removed naturally??
        print(spellId)
        if spellId == "59628" then
            print("event fires")
#

the correct spell id is getting printed

#

but the event fires print is never printing

real sigil
#

It prints the number, but not the event fires

#

Now, is it a number or a text?

dense wraith
#

ah

cyan cedar
dense wraith
#

good ol quotes

real sigil
#

Now, use the unit field instead of name field

dense wraith
#

is there a unit field on cleu?

real sigil
#

No, but you don't set that there anyway

#

When you itterate

dense wraith
#

yeah but how do i reference that unit from the aura applied

real sigil
#

I personally like keying by guid, but that shouldn't be relevant here

cyan cedar
#

check what i linked

real sigil
#

By they state key

#

If you set the unit, you can use unit formatting in display, like shortening the name or class color(which to be fair is quite useless in this case)

cyan cedar
#

i also added condition to show destName if it's on cd

real sigil
#

The thing between the []

dense wraith
#

cause any rogue could apply the aura

#

maybe im misunderstanding you

real sigil
#

It's currently name

#

The fact that you edit that state showed that you know it

dense wraith
#

oh i can get unit from a unit name or guid you're saying

real sigil
#

No

dense wraith
#

oh

real sigil
#

You have the unit.

#

When you build the state the first time, when you list all the rogues

#

The var is even called unit

#

Shove that in your state

#

Then you can use the unit text replacement

cyan cedar
#

Spaten wants you to set unit = unit

real sigil
#

Which allows fancy things

#

Yes! Class coloring the rogue is important!

dense wraith
#

oh like

allstates[unit] = {
                    show = true,
                    changed = true,
                    progressType = "timed",
                    duration = 0,
                    expirationTime = 0,
                    name = name,
                    autoHide = false,
                    unit = unit,
real sigil
#

No

#

So not change the key

#

The key is fine as name, even if I prefer the guid

cyan cedar
#

Spaten ignores the fact i posted edited version

real sigil
#

There is the unit missing

dense wraith
#

but just carry the unit in there so i can call class coloring later

#
allstates[name/guid] = {
                    show = true,
                    changed = true,
                    progressType = "timed",
                    duration = 0,
                    expirationTime = 0,
                    name = name,
                    autoHide = false,
                    unit = unit,
real sigil
#

And you can build a cache table when you itterate the group anyway and make a affected unit statevar which allows shortening AND class coloring

cyan cedar
#

i don't see the reason for unit field. You also just can color the text itself since class never changes

real sigil
#

Lies!

dense wraith
#

what if i die and get ressurected as a risen ally

real sigil
#

What if the color of rogues change?

dense wraith
#

i think they are warriors

cyan cedar
#

But if you ever would like to anchor this to raid frames you need that unit field

real sigil
#

The affectedUnit field could be nice and a little cache table isn't to bad

dense wraith
#

okay so it looks like my problem is solved, i have tools to work in advanced caching in the future, and i have a cool example of an options preview which i really like

#

thanks you both

cyan cedar
#

Make it clickable to summon Spaten next time

real sigil
#

Not advanced caching is you currently don't do anything, just a small improvement with neglectable impact

dense wraith
#

oh gotcha

real sigil
#

It's just a table you shove in aura env to save all players in your group

cyan cedar
#

i have no idea what Spaten wants to do with that

real sigil
#

Key it by guid or name (I prefer guid) and on aura applied get the unit from it and shove it in the state

#

Class coloring and shroetening of the destName

#

You can use a unit there too

cyan cedar
#

meh

real sigil
#

To shortening never works well with the color in strings

#

Like if the target is logolasgreatboi and you only want the first 5 chara

#

If you use escape sequences that will be a butchered hey color

cyan cedar
#

color in %c after sub

dense wraith
#

oh gosh all of us bad practice used 30s as a magic number

#

there's a talent that reduces tricks cd

real sigil
#

Glyph

cyan cedar
#

GL getting that info from other rogues

dense wraith
#

yeah lmao

real sigil
#

And you have to tither assume they use it or ignore it

dense wraith
#

yeah it's deep subtlety so im going to ignore it

real sigil
#

Ah, the glpyh did increase the duration not lower cooldown

dense wraith
#

hm while we're here is there a way i can get the aura duration from the aura applied event

#

i don't see an obvious one

#

while some people don't glyph it and it lasts for 6s

real sigil
#

Warriors get a different buff id

#

If you have the unitid of the target, you can check the buffs

dense wraith
#

maybe i missed the connection, but i don't know what this has to do with warriors

dense wraith
cyan cedar
#

don't do multiple elseifs like you do

real sigil
#

Also add some statevar that tells you about the status, otherwise how so you know if it's on cd, or on the rogue

dense wraith
cyan cedar
#
elseif event == "COMBAT_LOG_EVENT_UNFILTERED"
and subEvent == "SPELL_AURA_APPLIED"
and states[sourceGUID]
then
    if spellId == 59628 then --threat transfer (on self)
    elseif spellId == 57934 then--tricks primed (on self)  
    elseif spellId == 59628 then --threat transfer (on self)
    end
end```
#

and why you use same spellid twice

dense wraith
#

it's for removed

#

to stop tracking buff duration and start tracking ability cd

#
elseif event == "COMBAT_LOG_EVENT_UNFILTERED"
and subEvent == "SPELL_AURA_APPLIED"
and states[sourceGUID]
then
    if spellId == 59628 then --threat transfer (on self)
      --track buff duration
    elseif spellId == 57934 then--tricks primed (on self)  
      --track primed duration and primed target
    end

elseif event == "COMBAT_LOG_EVENT_UNFILTERED"
and subEvent == "SPELL_AURA_REMOVED"
and states[sourceGUID]
and spellId == 59628 then --threat transfer (on self)
  --track cd
end
dense wraith
cyan cedar
#

not sure about the logic

dense wraith
#

but i don't know what a statevar is but it sounds like what i want

#

oh i wrote the above backwards

#

there edited

real sigil
#

Duration, unit, name, expirwtiontime,
Basically everything your put in there is a variable in the state

cyan cedar
#

what is the goal actually

dense wraith
#

so i can just add a custom one like "trackingBuff" and "trackingCD"

cyan cedar
#

how WA have to work

dense wraith
#

picture 1: off cd
picture 2: on cd
picture 3: primed
picture 4: buff active and transferring threat

and this picture conveniently has 4 rogues doing all 4 different things

real sigil
#

You can just add something like status = "cd"

#

Think about desaturation too

dense wraith
#

good call

cyan cedar
#

now i start to feel like it slowly becomes zen tracker

real sigil
#

!tsu that has section for custom variables

twilit glacierBOT
dense wraith
real sigil
#

That one is quite specific and won't need add-on conms

#

That's not good, zen tracker just got popular, not good

dense wraith
#

yeah it looks like the exact same idea

#

at a glance

cyan cedar
#

what is "primed"

dense wraith
#

you cast tricks on someone, but it's not doing anything and doesn't go on cd

#

when you first attack then it "activates" and goes on cd, and gives you a threat transfer buff and them a damage buff

#

like hunter misdirect if you're familiar

cyan cedar
#

what if you dont attack

dense wraith
#

then after 30s it falls off

#

goes on cd and is ready 60s after you cast it

dense wraith
#

now i can account for whether it's glyphed or not

dense wraith
#

it seems fully functional so far, so now i'm trying to make it pretty - the swipe function is not working as i expected https://wago.io/ZHqf6K2_Z

#

swipe is fine when primed, but then snaps to nearly complete when activated, then doesn't swipe at all while on cooldown

#

(icon blown up for easy viewing)

dense wraith
#

also when regular small size, it seems to bounce around when first primed

#

just when first primed, it never moves otherwise. with pixel perfect ui scale ofc