how to call a function from xml
Hi,
I have trouble calling a function from the xml file <Scripts> <OnLoad> DEFAULT_CHAT_FRAME:AddMessage("Loading InstaBolt", 255, 0, 0); InstaBolt_OnLoad() DEFAULT_CHAT_FRAME:AddMessage("Loaded InstaBolt", 255, 0, 0); this:RegisterEvent("VARIABLES_LOADED") </OnLoad> <OnEvent> if (event == "VARIABLES_LOADED") then InstaBolt_Events() else InstaBolt_OnEvent(event,...) end </OnEvent> </Scripts> That code work before 3.1 and now it don't work anymore, the function InstaBolt_OnLoad() isn't call. I can't figure out what I need to do to be able to call function in my lua file. Can someone help me? |
This code is absolutely working as expected.
Is the addon really loaded? Are the LUA error messages activated? |
Errors in XML can prevent the rest of the file from loading. If there's an XML error above what you posted, then that could be the culprit. Is there anything about it in World of Warcraft/Logs/FrameXML.log?
Unless you're seeing "Loading InstaBolt", in which case there's a problem in InstaBolt_OnLoad(). If you're not seeing Lua error messages, try putting debugging statements such as the following between all major code blocks to narrow down where the error is occuring: Code:
DEFAULT_CHAT_FRAME:AddMessage("FUNCTION START") |
All times are GMT -6. The time now is 03:25 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI