Make WeakAuras play a sound x seconds after the WA shows?

I’m trying to make a WA that uses a sound to keep me from tunneling and not using Renewing Mist when it’s available. I have a WA set up with the custom sound to play on show, however it gets really annoying. I’d like it to play only if it’s been off CD for >5 seconds as that’s likely to indicate I’m tunneling, and then to loop that sound until the WA hides.

Is there a code I can use to make this happen?

Put this in Actions > On Show > Custom

local sound="Interface\\AddOns\\WeakAuras\\Media\\Sounds\\AirHorn.ogg"
local delay=5

if not (aura_env.soundTimer and not aura_env.soundTimer:IsCancelled()) then
    aura_env.soundTimer = C_Timer.NewTimer(delay,function()
            PlaySoundFile(sound)
    end)
end

and this in Actions > On Hide > Custom

if aura_env.soundTimer and not aura_env.soundTimer:IsCancelled() then
    aura_env.soundTimer:Cancel()
end
2 Likes

Hmm, this doesn’t seem to be working. Any ideas for troubleshooting it? Does it only work with a particular type of trigger or anything?

I didn’t specify a sound channel so it was defaulting to the sound effects channel and you wouldn’t hear anything if you had that muted.

I also missed that you wanted the sound to loop. It was only playing once.

I fixed those and changed it to use the “custom options” tab for configuration and uploaded it to wago.io

https://wago.io/qBPIP9HvZ

Looping is disabled by default because I found it annoying, but it’s in the options.

It should work with any trigger as long as it shows / hides.
I used the Cooldown Progress trigger with show set to ‘always’ and charges set to ‘>= 1’.

If it’s always visible then you couldn’t use show / hide to run the code. You should be able to use the same code on the conditions tab if you set it up right.

1 Like

Hi Sharinthia, appreciate the hell out of this. Wanted to know is there a way to make it so I don’t see the WA call in general chat window?

1 Like

I updated it on Wago.

The chat message is only supposed to show if you enable ‘debug’ on the custom options tab.
Thanks for letting me know it wasn’t respecting that setting.