View Single Post
01-12-10, 10:13 AM   #47
opismahname
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 23
Originally Posted by Xrystal View Post
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.
That one worked perfectly, thanks for helping!

And i got one question, is all these spaces needed like one end is with 4 spaces and 1 its no spaces.
  Reply With Quote