AceConsole-3.0 Documentation

Getting a hold of AceConsole:

local AceConsole = LibStub:GetLibrary("AceConsole-3.0")
local AceConsole = LibStub("AceConsole-3.0")


or the more common use embed AceConsole into your addon object:

local myAddon = LibStub("AceAddon-3.0"):NewAddon("myAddon", "AceConsole-3.0", ... )

or in a random other object/table:

local AceConsole = LibStub("AceConsole-3.0")
local mytable = {}
AceConsole:Embed(mytable)

For the further API documentation we will assume AceConsole embedded into some object.

AceConsole API

addon:Print( [chatframe,] ... )
	[chatframe] - Any messageframe that has a .AddMessage member
Will print the given argument list space separated to the given chatframe or DEFAULT_CHAT_FRAME.


addon:RegisterChatCommand( command[, func[, persist[, silent]]] )
	command (string) - chat command to be registered WITHOUT the leading "/"
	func (function|string) - function to call or self[func](self, ...) when func is a string
	persist (boolean) - false: the command will be soft disable/enabled when AceConsole is used as a mixin and the addon object is disabled/enabled (default: true)
	silent (boolean) - don't whine if the command already exists, silently fail
Register a simple chat command


addon:UnregisterChatCommand( command )
	command (string) - chat command to be unregistered WITHOUT the leading "/"
Unregisters the given command. Will silently fail if it does not exist.



addon:GetArgs( string[, numargs[, startpos]] )
	string (string) - the raw argument string to parse for arguments
	numargs (number) - How many arguments to get (default: 1)
	startpos (number) - Where in the string to start scanning (default: 1)
Returns arg1, arg2, ..., nextposition
Retreives space-separated arguments from the string. Quoted sections are recognized as a single argument, as are hyperlinks.
Missing arguments will be returned as nils. If the end of the string is encountered during scanning, 'nextposition' is returned as 1e9 (1 billion).

