#Cast Bar TSU

32 messages · Page 1 of 1 (latest)

coarse granite
#

Hi im trying to make a simple casting bar with TSU to detect boss casts in an encounter. At the moment Im just testing spell cast with myself because for some reason I cant get the bar to show the progress or duration

    if event == "COMBAT_LOG_EVENT_UNFILTERED" and arg2 =="SPELL_CAST_START" then
        
        local spell, _, _, _, startTime, endTime = UnitCastingInfo("player")
        
        allstates[arg5] = {
            changed = true,
            show = true,
            progressType = "timed",
            value = startTime,
            total = endTime,
            --target = target,
            name=spell,
            autoHide = true,
            index = 3
            
        }
        return true
    end
    
end
#

It triggers but the bar is empty

tulip root
#

!TSU

tropic stoneBOT
tulip root
#

With timed progress you need to provide duration and expirationTime, not value and total

#

But why are you coding this when the built in trigger provides all the info?

#

You're also mixing CLEU and UNIT APIs which can be unwise

coarse granite
#

Its for something bigger that im making later, this code is just for testing the basic, right now I just want to make a simple tsu cast bar that works when I cast whatever

tulip root
#

If you want to filter casts from a unit I'd still recommend working with a Cast Trigger and a Watched Trigger tbh.

#

!watched

coarse granite
#

Yes that will be taken on later once I get this bar to show 😭

#

Nevermind the whys, I only need a TSU cast bar that shows when I cast anything

coarse granite
tulip root
#

It does. You should refer to https://warcraft.wiki.gg/wiki/World_of_Warcraft_API when coding things like this

Warcraft Wiki

The WoW API is available to AddOns and macro scripts. It's officially documented in Blizzard_APIDocumentation which is accessible via the /api command. The Lua user interface code can be exported from the game client.

coarse granite
#

Alright

tulip root
#

!starterkit

tropic stoneBOT
tulip root
#

Might be useful info here if you didn't see it before

coarse granite
tulip root
#

Did you change the field names like I mentioned?

coarse granite
#

Yep

cedar cave
#

i really really want to loop back, why code at all?

#

i will forever blame this poor soul, but its the perfect example.
#the-war-within message

coarse granite
#

If its really important to know why, Im making a tsu group that will show me boss hp, power and casting bars when an encounter is going on. Why? because I really wanted to

tulip root
#

You should nil check the API call you're making tbh. CLEU is not the UNIT event that tells you the UnitCasting API has new info. It could fire before that info exists. If it did, you would still be going ahead and making a state, just with no info

tulip root
coarse granite
#

Its 3 different WAs in a dynamic grp, 1 for hp, 1 for power and this one for casting. The other 2 are already working fine

tulip root
#

If you were trying for 3 states on 1 trigger then I'd get it. But separate Auras. No code needed

cedar cave
#

because thats a simple default trigger each time. thats why i ask. that will deal with all the corner cases too, like channeling spells.
they clone. they exist for each boss unit

coarse granite
#

Will they show correctly in order of bossN ?

tulip root
#

If you sort them by unit yeah