Misplaced arguments?
So I'm working on my first Lua script and I thought I'd make a simple addon without any XML and without the need of extra frames and stuff, either way, what I am trying to do is whenever someone joins the guild, it will announce in gchat "Welcome name", however, for some reason, the "msg" argument seem to be gone from the function. The event says the args are message, sender, language, channel, target etc etc, but when I try to call the first argument, instead of message, it's sender.
Code:
local gAuto = CreateFrame("Frame") |
Your call self[event](...) is the culprit. It resullts in the call self.CHAT_MSG_GUILD(...) instead of self:CHAT_MSG_GUILD(...). The latter is equivalent to self.CHAT_MSG_GUILD(self, ...).
So simply changing self[event](...) to self[event](self, ...) should do the trick. |
Quote:
|
The following three are equivalent:
- self.event(self) - self:event() - self["event"](self) if however event is a variable (in contrast to the string "event"), your only way of calling is - self[event]() |
Quote:
|
All times are GMT -6. The time now is 04:19 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI