Thread: Event arguments
View Single Post
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