#Why doesn't this work?

15 messages · Page 1 of 1 (latest)

cloud mango
#
local function loss_of_control()
        local types = {
            "STUN_MECHANIC",
            "STUN",
            "FEAR_MECHANIC",
            "FEAR",
            "CHARM",
            "CONFUSE",
            "POSSESS"
        }
        local LOCCount = C_LossOfControl.GetActiveLossOfControlDataCount()
        for i=1,LOCCount do
            local data = C_LossOfControl.GetActiveLossOfControlData( i )
            for _, v in ipairs(types) do
                if v == data then
                    return true
                end
            end
        end
        return false
    end

It always returns false even when im cc'd

#

It's a custom function called in "Animations Tab" So it runs every frame

eager idol
#

no function in the actions tab wants a bool return

cloud mango
#

It can return true in my case
This is a local function

The "BIG" function with all the other stuff determines if my texture should draw or not

#

Everything works fine, it's just this specific function ic ant get to work

eager idol
#

thats not how it works

cloud mango
#
    local function clearcasting()
        local aura = AuraUtil.FindAuraByName("Clearcasting","player","HELPFUL")
        if aura == nil then
            return false
        end    
        return true
    end

Another local function that i regulary use... Works fine the way i call it

#

The problem still stands though...
The api seems to be working in wow classic since i can call /dump and get info from C_LossOfControl.GetActiveLossOfControlDataCount()

eager idol
#

that function is really just return AuraUtil.FindAuraByName()

#

you are ommiting so much information, i cant tell you what goes wrong.

#

but having that function inside of the animations tab and wanting it to return of the aura should trigger doesnt make sense. nothing in weakauras works like that.

cloud mango
#

The original code that is supposed to check if i'm CC'd never returns True
It should return true when i'm feared, charmed, etc....

hushed thorn
#

Is this chatgpt code?

fringe marsh
#

data is an object not just string