WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Weakauras: Delaying trigger check (https://www.wowinterface.com/forums/showthread.php?t=59127)

LonelyLitten 05-12-22 11:52 AM

Weakauras: Delaying trigger check
 
I am attempting to change this weakaura https://wago.io/IxMhs-_dB to instead of using the READY_CHECK event instead use the EQUIPMENT_SWAP_FINISHED event.

However just swapping to EQUIPMENT_SWAP_FINISHED leads to false positives, my guess being that the event is triggered before the game actually processes the items being added.

Is there a way to delay the trigger check a few seconds to ensure everything is correct before returning?

I have tried using C_Timer.After but that doesnt impact the return value of the custom trigger function

Code:

function(trigger)
   
    spellId = aura_env.spellId
    return C_Timer.After(3, function()
            if (GetPlayerAuraBySpellID(spellId) == nil) then
                print("bugged")
                    return true
                else
                    return false
                end
        end)
    end

obviously those returns are meaningless, but I think they show the goal of what I am looking to do here. print("bugged") being where i want to show the aura.


All times are GMT -6. The time now is 01:41 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI