<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Reference</title> <link rel="stylesheet" href="../luadoc.css" type="text/css" /> <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> </head> <body> <div id="container"> <div id="product"> <div id="product_logo"></div> <div id="product_name"><big><b></b></big></div> <div id="product_description"></div> </div> <!-- id="product" --> <div id="main"> <div id="navigation"> <h1>LuaDoc</h1> <ul> <li><a href="../index.html">Index</a></li> </ul> <!-- Module list --> <!-- File list --> <h1>Files</h1> <ul> <li> <a href="../files/ChatManager.html">ChatManager.lua</a> </li> <li> <a href="../files/Command.html">Command.lua</a> </li> <li><strong>CommandManager.lua</strong></li> <li> <a href="../files/EventHandler.html">EventHandler.lua</a> </li> <li> <a href="../files/Events.html">Events.lua</a> </li> <li> <a href="../files/Events_Chat.html">Events_Chat.lua</a> </li> <li> <a href="../files/GroupTools.html">GroupTools.lua</a> </li> <li> <a href="../files/Logger.html">Logger.lua</a> </li> <li> <a href="../files/PlayerManager.html">PlayerManager.lua</a> </li> <li> <a href="../files/QueueManager.html">QueueManager.lua</a> </li> <li> <a href="../files/String.html">String.lua</a> </li> <li> <a href="../files/Table.html">Table.lua</a> </li> </ul> </div> <!-- id="navigation" --> <div id="content"> <h1>File <code>CommandManager.lua</code></h1> <h2>Functions</h2> <table class="function_list"> <tr> <td class="name" nowrap><a href="#CM:AutoHelp">CM:AutoHelp</a> ()</td> <td class="summary">Prints all command names together with their help messages.</td> </tr> <tr> <td class="name" nowrap><a href="#CM:GetCommand">CM:GetCommand</a> (command)</td> <td class="summary">Gets the callback for a command by name.</td> </tr> <tr> <td class="name" nowrap><a href="#CM:HandleCommand">CM:HandleCommand</a> (command, args, isChat, player)</td> <td class="summary">Calls command with supplied args.</td> </tr> <tr> <td class="name" nowrap><a href="#CM:HasCommand">CM:HasCommand</a> (command)</td> <td class="summary">Check whether or not a command is registered.</td> </tr> <tr> <td class="name" nowrap><a href="#CM:Init">CM:Init</a> ()</td> <td class="summary">Initialize CommandManager.</td> </tr> <tr> <td class="name" nowrap><a href="#CM:Register">CM:Register</a> (names, access, func, help, command)</td> <td class="summary">Register a new command.</td> </tr> </table> <h2>Tables</h2> <table class="table_list"> <tr> <td class="name" nowrap><a href="#Command.CommandManager">Command.CommandManager</a></td> <td class="summary">Table holding all CommandManager methods.</td> </tr> </table> <br/> <br/> <h2><a name="functions"></a>Functions</h2> <dl class="function"> <dt><a name="CM:AutoHelp"></a><strong>CM:AutoHelp</strong> ()</dt> <dd> Prints all command names together with their help messages. </dd> <dt><a name="CM:GetCommand"></a><strong>CM:GetCommand</strong> (command)</dt> <dd> Gets the callback for a command by name. <h3>Parameters:</h3> <ul> <li> <code><em>command</em></code>: Name of the command to get. </li> </ul> <h3>Return value:</h3> <ul>Callback for the command, nil if no command was found. </ul> </dd> <dt><a name="CM:HandleCommand"></a><strong>CM:HandleCommand</strong> (command, args, isChat, player)</dt> <dd> Calls command with supplied args. <h3>Parameters:</h3> <ul> <li> <code><em>command</em></code>: Command to call (name) </li> <li> <code><em>args</em></code>: Table with arguments for the command. </li> <li> <code><em>isChat</em></code>: Is the command called from chat? </li> <li> <code><em>player</em></code>: Player object of the calling player (if chat) </li> </ul> <h3>Return values:</h3> <ol> <li>If successfull, returns result, otherwise false.</li> <li>Error message if not successful, otherwise nil. </li> </ol> </dd> <dt><a name="CM:HasCommand"></a><strong>CM:HasCommand</strong> (command)</dt> <dd> Check whether or not a command is registered. This does NOT take aliases into account. <h3>Parameters:</h3> <ul> <li> <code><em>command</em></code>: Command name to check. </li> </ul> </dd> <dt><a name="CM:Init"></a><strong>CM:Init</strong> ()</dt> <dd> Initialize CommandManager. NOTE: Unused. </dd> <dt><a name="CM:Register"></a><strong>CM:Register</strong> (names, access, func, help, command)</dt> <dd> Register a new command. <h3>Parameters:</h3> <ul> <li> <code><em>names</em></code>: </li> <li> <code><em>access</em></code>: Number depicting the access level needed to execute command. </li> <li> <code><em>func</em></code>: Function called to execute command. Called with params args, player and isChat. </li> <li> <code><em>help</em></code>: Message describing how the command should be used. </li> <li> <code><em>command</em></code>: Table containing aliases for the command. </li> </ul> </dd> </dl> <h2><a name="tables"></a>Tables</h2> <dl class="table"> <dt><a name="Command.CommandManager"></a><strong>Command.CommandManager</strong></dt> <dd>Table holding all CommandManager methods. This is referenced "CM" in CommandManager.lua.<br /><br /> <h3>Fields:</h3> <ul> <li> <code><em>Slash</em></code>: List of slash commands to register. </li> <li> <code><em>Commands</em></code>: Table holding all registered commands. </li> </ul> </dd> </dl> </div> <!-- id="content" --> </div> <!-- id="main" --> <div id="about"> <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> </html>