View Single Post
09-16-09, 12:36 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
1. use self instead of this
2. make your functions local instead of polluting the global namespace with nondescript/generic function names - they will get overwritten (unless you're calling them from an xml file but they're located in a lua file - then they'll need to be global - but at least make them less generic and specific to your addon)
3. semicolons ( are unnecessary in lua
4. are you passing the event arg to your OnEvent function? Then you need to tell the function how to find the event variable (ie, OnEvent(self,event))
5. you actually don't even need to pass those arguments and check for the event, though, because you're not doing different things based on event. Just call your code in OnEvent straight out
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote