- Lua/XML Help
||08-02-20 06:39 AM
How to trigger functions in game
Hi, have simple question..
Have a code with functions like this:
local version = 0.8
print("func " .. version .. " loaded")
function func_OnEvent(self, event)
How do I call _OnEvent in game? I cant get it. Is this via XML? Or should I just call it on top of the code by:
It seems weird.
||08-02-20 06:45 AM
xml is not a programming language. It just describes your frames.
You dont need xml for an addon.
Addons register for events that should trigger functions. Or you can trigger a timed event.
Take a look at SetScript
Edit: Keep in mind that functions should be local, too.
||08-02-20 06:50 AM
I saw XML file with:
<OnLoad> _OnLoad(); </OnLoad>
<OnEvent> _OnEvent(); </OnEvent>
<OnUpdate> _OnUpdate(); </OnUpdate>
So I thought with these you gotta call them.
That makes more sense now. Thank you
|All times are GMT -6. The time now is 05:21 AM.
vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI