Skip to content

Instantly share code, notes, and snippets.

@CapsAdmin
Created April 23, 2014 17:05
Show Gist options
  • Save CapsAdmin/11223727 to your computer and use it in GitHub Desktop.
Save CapsAdmin/11223727 to your computer and use it in GitHub Desktop.
function()
local buffName = "Twilight Ward"
local buff = UnitAura("player", buffName)
local timeRemain = ""
if buff then
local timeNow = GetTime()
local timeExpires = select(7, UnitAura("player", buffName))
local timeLeft = timeExpires - timeNow
if timeLeft < 5 then
timeRemain = math.floor(timeLeft)
if lastTime ~= timeRemain then
if timeRemain == 5 then
PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
elseif timeRemain == 4 then
PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
elseif timeRemain == 3 then
PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
elseif timeRemain == 2 then
PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
elseif timeRemain == 1 then
PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
elseif timeRemain == 0 then
PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
end
lastTime = timeRemain
end
end
end
return tostring(timeRemain)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment