View Single Post
01-10-10, 01:51 PM   #20
opismahname
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 23
Originally Posted by Akryn View Post
Right, now you've got that part correct. Now you just need to clean up your extra function (which was probably accidentally left there).

After that, there's only one more problem with this code:

lua Code:
  1. local frame = CreateFrame("FRAME", "RFFrame");
  2. frame:RegisterEvent("UNIT_AURA");
  3. --deleted duplicate function definition that was here
  4. local active = UnitBuff('player', 'Righteous Fury')
  5. local hasrf
  6. local function eventHandler(self, event, ...)
  7.     if not hasrf and active then
  8.         hasrf = true
  9.         print('Rigtheous Fury has been activated')
  10.     elseif hasrf and not active then
  11.         hasrf = false
  12.     end
  13. end
  14. frame:SetScript("OnEvent", eventHandler);

...and that is that "active" is declared in the wrong place. You need to check whether the player has the buff every time the function runs, not just when your addon loads. Is that enough information for you to figure out what to change?
I have no idea tbh... Can't find what's wrong more ;D
  Reply With Quote