This site makes extensive use of JavaScript.
Please
enable JavaScript
in your browser.
Classic Theme
Thottbot Theme
Stuck on syntax
Post Reply
Return to board index
Post by
619926
This post was from a user who has deleted their account.
Post by
pelf
Is it
this
or
self
?
Post by
Ketho
I think Pelf's question is kinda rethorical (><)
Since Cataclysm, the global variables:
this
,
event
,
arg1
, etc, are now
deprecated
If your frame is defined in the
.XML
file, you now also have to explicitly pass the arguments ..
frame defined in XML<OnLoad>TthAog1Load(self)</OnLoad>
<OnEvent>TthAog1Event(self, event, ...)</OnEvent>function TthAog1Load(self)
self:RegisterEvent("PLAYER_REGEN_DISABLED")
end
function TthAog1Event(self, event, ...)
-- do stuff
end
frame defined in Lua
local function OnEvent(self, event, ...)
-- do stuff
end
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_REGEN_DISABLED")
f:SetScript("OnEvent", OnEvent)
I would rather point you to these tutorial (threads) though
http://www.mmo-champion.com/threads/817817-Creating-Your-Own-WoW-Addon
http://www.wowpedia.org/Getting_started_with_writing_addons
http://www.wowinterface.com/forums/showthread.php?t=37610
http://forums.wowace.com/showthread.php?t=19092
Edit:
(concerning the error)
The error says you are trying to call a function on a nill value. I looked at wowwiki's API and actually couldn't find RegisterEvent()
RegisterEvent
is a "
widget
method
", and since
this
doesn't exist anymore,
this.RegisterEvent()
, also doesn't exist ..
Post by
pelf
Right on! Good info. I don't know too much about the API as relates to frames and event handling so much as Lua syntax itself. Even that I'm not too versed in
:)
.
Post by
619926
This post was from a user who has deleted their account.
Post by
Ketho
I only know some Lua, and actually wasn't around at the time that Blizz made those changes :(
Anyways, I'm nothing compared to the people who know, like 1, 2, or more (object oriented) programming languages =)
Post by
pelf
Well, outside of Lua, I know C# and VB.Net ... I learned on C++. But that's about it. I've gotten really obsessed with C# in the last 5 years and have been spending most of my time and learning there. It's pretty amazing IMHO.
Post by
HighFive
I never even knew there were such globals. It's so weird.
Good thing they removed them.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.