

MyAddon : RegisterChatCommand ( " myslash", " MySlashProcessorFunc" ) function MyAddon : MySlashProcessorFunc ( input ) - Process the slash command ('input' contains whatever follows the slash command) end Using AceAddon-3.0 Creating an addon objectĪfter making sure you've properly referenced the AceAddon-3.0 library, as well as LibStub (see the above sections), the main Lua file for the addon (such as a) can create an Ace3 addon instance like so: For the basics of what should be in here to make a completely Ace3-based addon, see the section below entitled "Using AceAddon-3.0". lua files will contain the actual code which runs your addon. lua extension, as long as you reference it in your. This file doesn't have to be named "a" - it can be pretty much anything with a. toc file instead, but embeds.xml helps make it clearer which parts of the code belong to the addon itself, and which are part of shared libraries. You could also reference each library's xml file in your addon's. As an example, using LibStub and loading a pair of Ace3 libraries from a Libs subdirectory in the addon's folder:Īdditional libraries can be added by adding additional Include lines. Use this xml file to specify the locations of libraries that should be loaded (typically referencing the library's own XML file via Include). Also, most addons will typically have at least one "main" Lua file which has the initial code to set up the addon - some people like to be consistent and call this something like "a" or "a" in every addon, others prefer to name the main code file after the addon itself, like the. Using a separate file named "embeds.xml" is a fairly commonly accepted way to specify which libraries you want to embed in your addon (such as Ace3 libraries).

toc file is simply a list of files that make up the addon. The lines which begin with # provide information about your addon itself to WoW - for instance, "Interface" specifies the interface version your addon was designed to be loaded with (at the time of this writing 40000), "Title" specifies how the name of the addon should be displayed in the addon window, et cetera.Īfter the # lines, the rest of the.
