Originally Posted by Cralor
Yes. You can continue with your same file. Making a new file is unnecessary in the beginning. You only ever really need to make a new file if you want to separate major code parts. (Such as the "core" code of an AddOn and the "option" GUI of an AddOn.)
As for the code there, yes you can actually do it just like that. One thing, though. You need to change RAID_WARNING to "RAID_WARNING" (the quotes are necessary). Other than that, the only other issue is the misspelling of "Righteous".
Hope this helps.
|
Didn't happen anything when i activated Righteous Fury with this code:
Code:
local frame = CreateFrame("Frame", "RFFrame")
frame:RegisterEvent("UNIT_AURA")
local active = UnitBuff('player', 'Righteous Fury')
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', 'Righteous Fury')
if not hasrf and active then
hasrf = true
RaidNotice_AddMessage(RaidWarningFrame, "Threat Buff Activated", ChatTypeInfo["RAID_WARNING"])
elseif hasrf and not active then
hasrf = false
end
end
frame:SetScript("OnEvent", eventHandler)
Can you see any problem that i did with the code?
Thanks for help anyway.