plastrader
28-10-2006, 06:16 PM
Hello,
I'm confused, maybe a bit "nubish", I've read the material @www.wowwiki.com
But I can't really get this together.
Which comes first of:
VARIABLES_LOADED
ADDON_LOADED
In my world ADDON_LOADED is the first thing that happens.
But, it seems functions/methods like:
GetRealmName()
UnitName("player")
and etc can't be "set" in either of ADDON_LOADED or VARIABLES_LOADED.
for example
If I put
function handle_addonload()
sendPrint(format("Hello %s from %s",UnitName("player"),GetRealmName()));
end
function sendPrint(string)
DEFAULT_CHAT_FRAME:AddMessage(string);
end
I get a script error.
Saying "error format, expected string, got nil"
I also get a script error while placing it in my "handle_varloaded()" function.
And not to mention what happens with variables when I do /console reloadui
it seems that variables set in the "header"(class variables) like
local myChecker=false;
is emtpy when I do /console reloadui.
Please help my confused brain.
I'm confused, maybe a bit "nubish", I've read the material @www.wowwiki.com
But I can't really get this together.
Which comes first of:
VARIABLES_LOADED
ADDON_LOADED
In my world ADDON_LOADED is the first thing that happens.
But, it seems functions/methods like:
GetRealmName()
UnitName("player")
and etc can't be "set" in either of ADDON_LOADED or VARIABLES_LOADED.
for example
If I put
function handle_addonload()
sendPrint(format("Hello %s from %s",UnitName("player"),GetRealmName()));
end
function sendPrint(string)
DEFAULT_CHAT_FRAME:AddMessage(string);
end
I get a script error.
Saying "error format, expected string, got nil"
I also get a script error while placing it in my "handle_varloaded()" function.
And not to mention what happens with variables when I do /console reloadui
it seems that variables set in the "header"(class variables) like
local myChecker=false;
is emtpy when I do /console reloadui.
Please help my confused brain.