WoW:Getting started with writing AddOns: Difference between revisions

Line 65: Line 65:


<pre>
<pre>
function MyAddOn_OnLoad()
function MyAddOn_OnLoad()
    SlashCmdList["MyAddOn"] = MyAddOn_SlashCommand;
    SlashCmdList["MyAddOn"] = MyAddOn_SlashCommand;
    SLASH_MYADDON1= "/myaddon";
    SLASH_MYADDON1= "/myaddon";
    this:RegisterEvent("VARIABLES_LOADED")
    this:RegisterEvent("VARIABLES_LOADED")
end
end
</pre>


<pre>
function MyAddOn_SlashCommand()
function MyAddOn_SlashCommand()
    print("Hello, WoW!")
    print("Hello, WoW!")
end
end
</pre>
</pre>