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