Thread Tools Display Modes
10-05-10, 10:53 AM   #1
Elendhriel
A Deviate Faerie Dragon
Join Date: Jan 2010
Posts: 13
Track Missing Buffs

I am looking for a code snippet to use and learn from how to track missing personal Buffs. In Cataclysm every time I die I lose Righteous Fury and sometimes I forget to rebuff it which doesn't help when tanking
  Reply With Quote
10-05-10, 11:17 AM   #2
Guardix
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 42
You can use UnitAura(unit, spell)
unit would then be "player" and spell "Righteous Fury"

If the function returns nil, you can display some frame to notice yourself
Documentation here:
http://www.wowwiki.com/API_UnitAura
__________________
  Reply With Quote
10-05-10, 11:24 AM   #3
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
Code:
local f = CreateFrame("Frame",nil,UIParent)
f:SetWidth(60); f:SetHeight(60)
local t = f:CreateTexture(nil, "ARTWORK")
t:SetAllPoints(f)
f.tex = t
f:Hide()
f:SetPoint("CENTER",UIParent,"CENTER",0,0)

local spellID = <Righteous Fury id>
f.tex:SetTexture(select(3,GetSpellInfo(spellID)))

f:RegisterEvent("UNIT_AURA")
f:SetScript("OnEvent",function(self,event,unit)
    if unit ~= "player" then return end
    if UnitAura(unit,GetSpellInfo(spellID),nil,"HELPFUL") then
         self:Show()
    else self:Hide() end
end)
  Reply With Quote
10-05-10, 06:40 PM   #4
Elendhriel
A Deviate Faerie Dragon
Join Date: Jan 2010
Posts: 13
Thanks that code really helped could change / extend it to my needs
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Track Missing Buffs

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off