<p>The Inputfunc is the last fixed step on the <aclass="reference internal"href="../Concepts/Messagepath.html#ingoing-message-path"><spanclass="std std-doc">Ingoing message path</span></a>. The available Inputfuncs are looked up and called using <codeclass="docutils literal notranslate"><spanclass="pre">commandtuple</span></code> structures sent from the client. The job of the Inputfunc is to perform whatever action is requested, by firing a Command, performing a database query or whatever is needed.</p>
<p>Given a <codeclass="docutils literal notranslate"><spanclass="pre">commandtuple</span></code> on the form</p>
<p>The default inputfuncs are found in <aclass="reference internal"href="../api/evennia.server.inputfuncs.html#evennia-server-inputfuncs"><spanclass="std std-ref">evennia/server/inputfuncs.py</span></a>.</p>
<li><p>Add a function on the above form to <codeclass="docutils literal notranslate"><spanclass="pre">mygame/server/conf/inputfuncs.py</span></code>. Your function must be in the global, outermost scope of that module and not start with an underscore (<codeclass="docutils literal notranslate"><spanclass="pre">_</span></code>) to be recognized as an inputfunc. i</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">reload</span></code> the server.</p></li>
</ol>
<p>To overload a default inputfunc (see below), just add a function with the same name. You can also extend the settings-list <codeclass="docutils literal notranslate"><spanclass="pre">INPUT_FUNC_MODULES</span></code>.</p>
<p>All global-level functions with a name not starting with <codeclass="docutils literal notranslate"><spanclass="pre">_</span></code> in these module(s) will be used by Evennia as an inputfunc. The list is imported from left to right, so latter imported functions will replace earlier ones.</p>
<p>This is the most common of inputs, and the only one supported by every traditional mud. The argument is usually what the user sent from their command line. Since all text input from the user
like this is considered a <aclass="reference internal"href="Commands.html"><spanclass="doc std std-doc">Command</span></a>, this inputfunc will do things like nick-replacement and then pass on the input to the central Commandhandler.</p>
<p>This is a direct command for setting protocol options. These are settable with the <codeclass="docutils literal notranslate"><spanclass="pre">@option</span></code>
command, but this offers a client-side way to set them. Not all connection protocols makes use of
all flags, but here are the possible keywords:</p>
<ulclass="simple">
<li><p>get (bool): If this is true, ignore all other kwargs and immediately return the current settings
as an outputcommand <codeclass="docutils literal notranslate"><spanclass="pre">("client_options",</span><spanclass="pre">(),</span><spanclass="pre">{key=value,</span><spanclass="pre">...})</span></code>-</p></li>
<li><p>client (str): A client identifier, like “mushclient”.</p></li>
<li><p>version (str): A client version</p></li>
<li><p>ansi (bool): Supports ansi colors</p></li>
<li><p>xterm256 (bool): Supports xterm256 colors or not</p></li>
<li><p>mxp (bool): Supports MXP or not</p></li>
<li><p>utf-8 (bool): Supports UTF-8 or not</p></li>
<div><p>Note that there are two GMCP aliases to this inputfunc - <codeclass="docutils literal notranslate"><spanclass="pre">hello</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">supports_set</span></code>, which means it will be accessed via the GMCP <codeclass="docutils literal notranslate"><spanclass="pre">Hello</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">Supports.Set</span></code> instructions assumed by some clients.</p>
<p>This is a convenience wrapper that retrieves the current options by sending “get” to <codeclass="docutils literal notranslate"><spanclass="pre">client_options</span></code> above.</p>
<p>Returns an outputcommand on the form <codeclass="docutils literal notranslate"><spanclass="pre">("get_inputfuncs",</span><spanclass="pre">(),</span><spanclass="pre">{funcname:docstring,</span><spanclass="pre">...})</span></code> - a list of all the available inputfunctions along with their docstrings.</p>
<p>Retrieves a value from the Character or Account currently controlled by this Session. Takes one argument, This will only accept particular white-listed names, you’ll need to overload the function to expand. By default the following values can be retrieved:</p>
<li><p>Output: Depends on the repeated function. Will return <codeclass="docutils literal notranslate"><spanclass="pre">("text",</span><spanclass="pre">(repeatlist),{}</span></code> with a list of
accepted names if given an unfamiliar callback name.</p></li>
<p>This will tell evennia to repeatedly call a named function at a given interval. Behind the scenes this will set up a <aclass="reference internal"href="TickerHandler.html"><spanclass="doc std std-doc">Ticker</span></a>. Only previously acceptable functions are possible to repeat-call in this way, you’ll need to overload this inputfunc to add the ones you want to offer. By default only two example functions are allowed, “test1” and “test2”, which will just echo a text back at the given interval. Stop the repeat by sending <codeclass="docutils literal notranslate"><spanclass="pre">"stop":</span><spanclass="pre">True</span></code> (note that you must include both the callback name and interval for Evennia to know what to stop).</p>
<p>This is a convenience wrapper for sending “stop” to the <codeclass="docutils literal notranslate"><spanclass="pre">repeat</span></code> inputfunc.</p>
</section>
<sectionid="monitor">
<h3>monitor<aclass="headerlink"href="#monitor"title="Permalink to this headline">¶</a></h3>
<p>This sets up on-object monitoring of Attributes or database fields. Whenever the field or Attribute changes in any way, the outputcommand will be sent. This is using the <aclass="reference internal"href="MonitorHandler.html"><spanclass="doc std std-doc">MonitorHandler</span></a> behind the scenes. Pass the “stop” key to stop monitoring. Note that you must supply the name also when stopping to let the system know which monitor should be cancelled.</p>
<p>Only fields/attributes in a whitelist are allowed to be used, you have to overload this function to add more. By default the following fields/attributes can be monitored:</p>