mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-28 03:55:23 +09:00
401 lines
13 KiB
HTML
401 lines
13 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
<head>
|
|
<title>Reference</title>
|
|
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
|
</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">
|
|
|
|
|
|
<!-- Menu -->
|
|
|
|
<div id="navigation">
|
|
<br/>
|
|
<h1>ldoc</h1>
|
|
|
|
<ul>
|
|
<li><a href="../index.html">Index</a></li>
|
|
</ul>
|
|
|
|
<h2>Contents</h2>
|
|
<ul>
|
|
<li><a href="#Functions">Functions</a></li>
|
|
<li><a href="#Tables">Tables</a></li>
|
|
<li><a href="#Fields">Fields</a></li>
|
|
</ul>
|
|
|
|
|
|
<h2>Modules</h2>
|
|
<ul class="nowrap">
|
|
<li><a href="../modules/FSM.html">FSM</a></li>
|
|
<li><strong>ExpGamingCore.Commands</strong></li>
|
|
<li><a href="../modules/modules.expgamingcore.gui.guiparts.center.html">modules.expgamingcore.gui.guiparts.center</a></li>
|
|
<li><a href="../modules/modules.expgamingcore.gui.guiparts.inputs.html">modules.expgamingcore.gui.guiparts.inputs</a></li>
|
|
<li><a href="../modules/modules.expgamingcore.gui.guiparts.left.html">modules.expgamingcore.gui.guiparts.left</a></li>
|
|
<li><a href="../modules/modules.expgamingcore.gui.guiparts.popup.html">modules.expgamingcore.gui.guiparts.popup</a></li>
|
|
<li><a href="../modules/modules.expgamingcore.gui.guiparts.toolbar.html">modules.expgamingcore.gui.guiparts.toolbar</a></li>
|
|
<li><a href="../modules/modules.expgamingcore.gui.control.html">modules.expgamingcore.gui.control</a></li>
|
|
<li><a href="../modules/ExpGamingCore.Ranking.html">ExpGamingCore.Ranking</a></li>
|
|
<li><a href="../modules/ExpGamingCore.Server.html">ExpGamingCore.Server</a></li>
|
|
<li><a href="../modules/ExpGamingCore.Sync.html">ExpGamingCore.Sync</a></li>
|
|
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
|
|
<li><a href="../modules/StdLib.Color.html">StdLib.Color</a></li>
|
|
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
|
|
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
|
|
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
|
|
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<h1>Module <code>ExpGamingCore.Commands</code></h1>
|
|
<p>A full ranking system for factorio.</p>
|
|
<p></p>
|
|
<h3>Info:</h3>
|
|
<ul>
|
|
<li><strong>License</strong>: https://github.com/explosivegaming/scenario/blob/master/LICENSE</li>
|
|
<li><strong>Author</strong>: Cooldude2606</li>
|
|
</ul>
|
|
|
|
|
|
<h2><a href="#Functions">Functions</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#format_inputs">format_inputs (command)</a></td>
|
|
<td class="summary">Returns the inputs of this command as a formated string</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#validate_args">validate_args (event)</a></td>
|
|
<td class="summary">Used to validate the arguments of a command, will understand strings with "" as a single param else spaces divede the params</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_commands">get_commands (player)</a></td>
|
|
<td class="summary">Used to return all the commands a player can use</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#add_command">add_command (name[, description='No Description'][, inputs=an infite string], callback)</a></td>
|
|
<td class="summary">Used to define commands</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#Tables">Tables</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#validate">validate</a></td>
|
|
<td class="summary">Collection of funcations that can be used to validate inputs</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#Fields">Fields</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#error">error</a></td>
|
|
<td class="summary">Used as an error constant for validation</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#data">data</a></td>
|
|
<td class="summary">Index of all command data</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "format_inputs"></a>
|
|
<strong>format_inputs (command)</strong>
|
|
</dt>
|
|
<dd>
|
|
Returns the inputs of this command as a formated string
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">command</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a>, <a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a> or <span class="type">event</span></span>
|
|
the command to get the inputs of
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
|
|
the formated string for the inputs
|
|
</ol>
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<pre class="example">commands.format_inputs(<span class="string">'interface'</span>) <span class="comment">-- returns <code> (if you have ExpGamingCore.Server)</span></pre>
|
|
</ul>
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "validate_args"></a>
|
|
<strong>validate_args (event)</strong>
|
|
</dt>
|
|
<dd>
|
|
Used to validate the arguments of a command, will understand strings with "" as a single param else spaces divede the params
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">event</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
|
|
this is the event created by add_command not on_console_command
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
|
|
the error that happend while parsing the args
|
|
</ol>
|
|
<h3>Or</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
|
|
the args for this command
|
|
</ol>
|
|
<h3>Or</h3>
|
|
<ol>
|
|
|
|
command.error
|
|
</ol>
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<pre class="example">commands.validate_args(event) <span class="comment">-- returns args table</span></pre>
|
|
</ul>
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_commands"></a>
|
|
<strong>get_commands (player)</strong>
|
|
</dt>
|
|
<dd>
|
|
Used to return all the commands a player can use
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">player</span>
|
|
<span class="types"><span class="type">index</span>, <span class="type">name</span> or <span class="type">player</span></span>
|
|
the player to test as
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
|
|
a table containg all the commands the player can use
|
|
</ol>
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<pre class="example">get_commands(<span class="number">1</span>) <span class="comment">-- return table of command data for each command that the player can use</span></pre>
|
|
</ul>
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "add_command"></a>
|
|
<strong>add_command (name[, description='No Description'][, inputs=an infite string], callback)</strong>
|
|
</dt>
|
|
<dd>
|
|
Used to define commands
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">name</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
|
|
the name of the command
|
|
</li>
|
|
<li><span class="parameter">description</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
|
|
the description of the command
|
|
(<em>default</em> 'No Description')
|
|
</li>
|
|
<li><span class="parameter">inputs</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
|
|
a table of the inputs to be used, last index being true makes the last parameter open ended (longer than one word)
|
|
(<em>default</em> an infite string)
|
|
</li>
|
|
<li><span class="parameter">callback</span>
|
|
<span class="types"><span class="type">function</span></span>
|
|
the function to call on the event
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<pre class="example"><span class="comment">--see examples in file</span></pre>
|
|
</ul>
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "validate"></a>
|
|
<strong>validate</strong>
|
|
</dt>
|
|
<dd>
|
|
Collection of funcations that can be used to validate inputs
|
|
|
|
|
|
<h3>Fields:</h3>
|
|
<ul>
|
|
<li><span class="parameter">__comment</span>
|
|
replace _ with - the ldoc did not like me using - in the names
|
|
</li>
|
|
<li><span class="parameter">string</span>
|
|
basicly does nothing but a type filed is required
|
|
</li>
|
|
<li><span class="parameter">string_inf</span>
|
|
same as string but is infite in length, must be last arg
|
|
</li>
|
|
<li><span class="parameter">string_len</span>
|
|
same as string but can define a max lengh
|
|
</li>
|
|
<li><span class="parameter">number</span>
|
|
converts the input into a number
|
|
</li>
|
|
<li><span class="parameter">number_int</span>
|
|
conerts the input to a number and floors it
|
|
</li>
|
|
<li><span class="parameter">number_range</span>
|
|
allows a number in a range after it has been floored min < math.floor(X) <= max
|
|
</li>
|
|
<li><span class="parameter">number_range</span>
|
|
allows a number in a range after it has been floored min < math.floor(X) <= max
|
|
</li>
|
|
<li><span class="parameter">player</span>
|
|
converts the input into a valid player
|
|
</li>
|
|
<li><span class="parameter">player_online</span>
|
|
converts the input to a player if the player is online
|
|
</li>
|
|
<li><span class="parameter">player_alive</span>
|
|
converts the input to a player if the player is online and alive
|
|
</li>
|
|
<li><span class="parameter">player_rank</span>
|
|
-online converts the input to a player if the player is a lower rank than the user and online
|
|
</li>
|
|
<li><span class="parameter">player_rank</span>
|
|
-online converts the input to a player if the player is a lower rank than the user and online
|
|
</li>
|
|
<li><span class="parameter">player_rank_alive</span>
|
|
converts the input to a player if the player is a lower rank than the user and online and alive
|
|
</li>
|
|
<li><span class="parameter">type</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
|
|
the type that the value should be
|
|
</li>
|
|
<li><span class="parameter">value</span>
|
|
the value that will be tested
|
|
</li>
|
|
<li><span class="parameter">...</span>
|
|
any other data that can be passed to the function
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<pre class="example">commands.validate[<span class="global">type</span>](value,event,...)</pre>
|
|
</ul>
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "error"></a>
|
|
<strong>error</strong>
|
|
</dt>
|
|
<dd>
|
|
Used as an error constant for validation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<li><pre class="example"><span class="keyword">return</span> commands.<span class="global">error</span>, <span class="string">'err message'</span></pre></li>
|
|
<li><pre class="example"><span class="keyword">return</span> commands.<span class="global">error</span>(<span class="string">'err message'</span>)</pre></li>
|
|
</ul>
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "data"></a>
|
|
<strong>data</strong>
|
|
</dt>
|
|
<dd>
|
|
Index of all command data
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">key</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a>, <a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a> or <span class="type">event</span></span>
|
|
the command that will be returned: string is the name, table is the command data, event is event from add_command
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<li><pre class="example">commands.command_name <span class="comment">-- returns command data</span></pre></li>
|
|
<li><pre class="example">commands.data <span class="comment">-- returns all data</span></pre></li>
|
|
</ul>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
</div> <!-- id="content" -->
|
|
</div> <!-- id="main" -->
|
|
<div id="about">
|
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
|
<i style="float:right;">Last updated 2018-06-05 19:31:42 </i>
|
|
</div> <!-- id="about" -->
|
|
</div> <!-- id="container" -->
|
|
</body>
|
|
</html>
|