View Single Post
01-11-10, 03:03 PM   #46
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
Originally Posted by opismahname View Post
That one didnt work either actually.
Hmm, it didn't ? Weird.

This is the code I have running on my Paladin. She's low level so not able to test the buff you are playing with. This works fine for me.

Code:
local frame = CreateFrame("Frame", "RFFrame")
frame:RegisterEvent("UNIT_AURA")

local active = UnitBuff("player", "Seal of Righteousness") 
local hasrf = (active) -- will contain a boolean, true if 'active' contains a string, and false if 'active' contains nothing(nil)

local function eventHandler(self, event, ...)
    active = UnitBuff("player", "Seal of Righteousness")
    if not hasrf and active then
        hasrf = true
        RaidNotice_AddMessage(RaidWarningFrame, "Seal of Righteousness Buff Activated", ChatTypeInfo["RAID_WARNING"])
    elseif hasrf and not active then
        hasrf = false
        RaidNotice_AddMessage(RaidWarningFrame, "Seal of Righteousness Buff Deactivated", ChatTypeInfo["RAID_WARNING"])
    elseif active then
        RaidNotice_AddMessage(RaidWarningFrame, "Seal of Righteousness Buff Active", ChatTypeInfo["RAID_WARNING"])
    end
end
frame:SetScript("OnEvent", eventHandler)
Here are some screenshots showing the message appearing. Watch the top center of the screen.

The first image shows the message that appears if you cast the buff while one is already active. The second, when the buff is removed and the third, when a fresh buff is activated.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_011110_205924.jpg
Views:	768
Size:	333.6 KB
ID:	3836  Click image for larger version

Name:	WoWScrnShot_011110_205933.jpg
Views:	775
Size:	319.7 KB
ID:	3837  Click image for larger version

Name:	WoWScrnShot_011110_205938.jpg
Views:	751
Size:	339.1 KB
ID:	3838  
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote