Thread Tools Display Modes
Prev Previous Post   Next Post Next
12-05-10, 06:32 PM   #1
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
Event arguments

I've never really been able to understand how to work in arguments into my "OnEvent" frames, and now I need to use it. I'm trying to make it so my addon does a certain function when the auras of my target change, so I went about it like this:

Code:
local OnEvent = CreateFrame("Frame")
OnEvent:SetScript("OnEvent", function(self, event, addon, ...)
if (event=="UNIT_AURA") then
   if (arg1=="target") then
      myFunction()
   end
end
end)
OnEvent:RegisterEvent("UNIT_AURA")
I have no idea if I'm doing this right, I'm going to guess no since it's not working :P If anyone could help I'd be very appreciative!

Thanks!!
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Event arguments


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