Thread: I admit defeat
View Single Post
12-06-13, 02:16 PM   #2
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
You need to register events before you can trigger them:

Lua Code:
  1. for k, v in pairs(Eavu) do
  2.  frame:RegisterEvent(k); -- Register all events for which handlers have been defined
  3. end
  4.  
  5. frame:SetScript("OnEvent", function(self, event, ...)
  6.  Eavu[event](self, ...); -- call one of the functions above
  7. end)

I think coding when you're sick is a bad idea, i tried do "programming" once i was drunk, thex next day was a massive omg wtf rollback.

However that table should contain the events you want to register:

Lua Code:
  1. local Events = {
  2.  [1] = "ADDON_LOADED",
  3.  [2] = "COMBAT_LOG_EVENT_UNFILTERED",
  4.  [3] = "ETCETC"
  5. }
  6.  
  7. for k, v in pairs(Events) do
  8.  frame:RegisterEvent(v); -- Register all events for which handlers have been defined
  9. end

Also if you use the in pairs loop then you need to register it's v part not the k. (But it depends how your table looks like.)

Last edited by Resike : 12-06-13 at 02:32 PM.
  Reply With Quote