mirror of
https://github.com/evennia/evennia.git
synced 2026-03-19 14:26:30 +01:00
1677 lines
No EOL
138 KiB
HTML
1677 lines
No EOL
138 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<title>evennia.contrib.ingame_python package — Evennia 1.0-dev documentation</title>
|
||
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
|
||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||
<script src="../_static/jquery.js"></script>
|
||
<script src="../_static/underscore.js"></script>
|
||
<script src="../_static/doctools.js"></script>
|
||
<script src="../_static/language_data.js"></script>
|
||
<link rel="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Search" href="../search.html" />
|
||
|
||
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
|
||
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||
|
||
</head><body>
|
||
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
|
||
|
||
<div class="body" role="main">
|
||
|
||
<div class="section" id="module-evennia.contrib.ingame_python">
|
||
<span id="evennia-contrib-ingame-python-package"></span><h1>evennia.contrib.ingame_python package<a class="headerlink" href="#module-evennia.contrib.ingame_python" title="Permalink to this headline">¶</a></h1>
|
||
<div class="section" id="submodules">
|
||
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
|
||
</div>
|
||
<div class="section" id="module-evennia.contrib.ingame_python.callbackhandler">
|
||
<span id="evennia-contrib-ingame-python-callbackhandler-module"></span><h2>evennia.contrib.ingame_python.callbackhandler module<a class="headerlink" href="#module-evennia.contrib.ingame_python.callbackhandler" title="Permalink to this headline">¶</a></h2>
|
||
<p>Module containing the CallbackHandler for individual objects.</p>
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.callbackhandler.</code><code class="sig-name descname">Callback</code><span class="sig-paren">(</span><em class="sig-param">obj</em>, <em class="sig-param">name</em>, <em class="sig-param">number</em>, <em class="sig-param">code</em>, <em class="sig-param">author</em>, <em class="sig-param">valid</em>, <em class="sig-param">parameters</em>, <em class="sig-param">created_on</em>, <em class="sig-param">updated_by</em>, <em class="sig-param">updated_on</em><span class="sig-paren">)</span><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">tuple</span></code></p>
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback._asdict">
|
||
<code class="sig-name descname">_asdict</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback._asdict" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return a new OrderedDict which maps field names to their values.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback._field_defaults">
|
||
<code class="sig-name descname">_field_defaults</code><em class="property"> = {}</em><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback._field_defaults" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback._fields">
|
||
<code class="sig-name descname">_fields</code><em class="property"> = ('obj', 'name', 'number', 'code', 'author', 'valid', 'parameters', 'created_on', 'updated_by', 'updated_on')</em><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback._fields" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback._fields_defaults">
|
||
<code class="sig-name descname">_fields_defaults</code><em class="property"> = {}</em><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback._fields_defaults" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback._make">
|
||
<em class="property">classmethod </em><code class="sig-name descname">_make</code><span class="sig-paren">(</span><em class="sig-param">iterable</em><span class="sig-paren">)</span><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback._make" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Make a new Callback object from a sequence or iterable</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback._replace">
|
||
<code class="sig-name descname">_replace</code><span class="sig-paren">(</span><em class="sig-param">**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback._replace" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return a new Callback object replacing specified fields with new values</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback.author">
|
||
<em class="property">property </em><code class="sig-name descname">author</code><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback.author" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Alias for field number 4</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback.code">
|
||
<em class="property">property </em><code class="sig-name descname">code</code><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback.code" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Alias for field number 3</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback.created_on">
|
||
<em class="property">property </em><code class="sig-name descname">created_on</code><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback.created_on" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Alias for field number 7</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback.name">
|
||
<em class="property">property </em><code class="sig-name descname">name</code><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback.name" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Alias for field number 1</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback.number">
|
||
<em class="property">property </em><code class="sig-name descname">number</code><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback.number" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Alias for field number 2</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback.obj">
|
||
<em class="property">property </em><code class="sig-name descname">obj</code><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback.obj" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Alias for field number 0</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback.parameters">
|
||
<em class="property">property </em><code class="sig-name descname">parameters</code><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback.parameters" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Alias for field number 6</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback.updated_by">
|
||
<em class="property">property </em><code class="sig-name descname">updated_by</code><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback.updated_by" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Alias for field number 8</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback.updated_on">
|
||
<em class="property">property </em><code class="sig-name descname">updated_on</code><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback.updated_on" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Alias for field number 9</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.Callback.valid">
|
||
<em class="property">property </em><code class="sig-name descname">valid</code><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.Callback.valid" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Alias for field number 5</p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.callbackhandler.</code><code class="sig-name descname">CallbackHandler</code><span class="sig-paren">(</span><em class="sig-param">obj</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/callbackhandler.html#CallbackHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||
<p>The callback handler for a specific object.</p>
|
||
<p>The script that contains all callbacks will be reached through this
|
||
handler. This handler is therefore a shortcut to be used by
|
||
developers. This handler (accessible through <cite>obj.callbacks</cite>) is a
|
||
shortcut to manipulating callbacks within this object, getting,
|
||
adding, editing, deleting and calling them.</p>
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler.__init__">
|
||
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">obj</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/callbackhandler.html#CallbackHandler.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler.__init__" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Initialize self. See help(type(self)) for accurate signature.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler.add">
|
||
<code class="sig-name descname">add</code><span class="sig-paren">(</span><em class="sig-param">callback_name</em>, <em class="sig-param">code</em>, <em class="sig-param">author=None</em>, <em class="sig-param">valid=False</em>, <em class="sig-param">parameters=''</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/callbackhandler.html#CallbackHandler.add"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler.add" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Add a new callback for this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>callback_name</strong> (<em>str</em>) – the name of the callback to add.</p></li>
|
||
<li><p><strong>code</strong> (<em>str</em>) – the Python code associated with this callback.</p></li>
|
||
<li><p><strong>author</strong> (<em>Character</em><em> or </em><em>Account</em><em>, </em><em>optional</em>) – the author of the callback.</p></li>
|
||
<li><p><strong>valid</strong> (<em>bool</em><em>, </em><em>optional</em>) – should the callback be connected?</p></li>
|
||
<li><p><strong>parameters</strong> (<em>str</em><em>, </em><em>optional</em>) – optional parameters.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>The callback definition that was added or None.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler.all">
|
||
<code class="sig-name descname">all</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/callbackhandler.html#CallbackHandler.all"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler.all" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return all callbacks linked to this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns</dt>
|
||
<dd class="field-odd"><p>callback}. The callback
|
||
is returned as a namedtuple to simplify manipulation.</p>
|
||
</dd>
|
||
<dt class="field-even">Return type</dt>
|
||
<dd class="field-even"><p>All callbacks in a dictionary callback_name</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler.call">
|
||
<code class="sig-name descname">call</code><span class="sig-paren">(</span><em class="sig-param">callback_name</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/callbackhandler.html#CallbackHandler.call"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler.call" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Call the specified callback(s) bound to this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>callback_name</strong> (<em>str</em>) – the callback name to call.</p></li>
|
||
<li><p><strong>*args</strong> – additional variables for this callback.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<dl class="simple">
|
||
<dt>Kwargs:</dt><dd><p>number (int, optional): call just a specific callback.
|
||
parameters (str, optional): call a callback with parameters.
|
||
locals (dict, optional): a locals replacement.</p>
|
||
</dd>
|
||
</dl>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns</dt>
|
||
<dd class="field-odd"><p>True to report the callback was called without interruption,
|
||
False otherwise. If the callbackHandler isn’t found, return
|
||
None.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler.edit">
|
||
<code class="sig-name descname">edit</code><span class="sig-paren">(</span><em class="sig-param">callback_name</em>, <em class="sig-param">number</em>, <em class="sig-param">code</em>, <em class="sig-param">author=None</em>, <em class="sig-param">valid=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/callbackhandler.html#CallbackHandler.edit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler.edit" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Edit an existing callback bound to this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>callback_name</strong> (<em>str</em>) – the name of the callback to edit.</p></li>
|
||
<li><p><strong>number</strong> (<em>int</em>) – the callback number to be changed.</p></li>
|
||
<li><p><strong>code</strong> (<em>str</em>) – the Python code associated with this callback.</p></li>
|
||
<li><p><strong>author</strong> (<em>Character</em><em> or </em><em>Account</em><em>, </em><em>optional</em>) – the author of the callback.</p></li>
|
||
<li><p><strong>valid</strong> (<em>bool</em><em>, </em><em>optional</em>) – should the callback be connected?</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>The callback definition that was edited or None.</p>
|
||
</dd>
|
||
<dt class="field-odd">Raises</dt>
|
||
<dd class="field-odd"><p><strong>RuntimeError if the callback is locked.</strong> – </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler.format_callback">
|
||
<em class="property">static </em><code class="sig-name descname">format_callback</code><span class="sig-paren">(</span><em class="sig-param">callback</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/callbackhandler.html#CallbackHandler.format_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler.format_callback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return the callback namedtuple to represent the specified callback.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>callback</strong> (<em>dict</em>) – the callback definition.</p>
|
||
</dd>
|
||
</dl>
|
||
<p>The callback given in argument should be a dictionary containing
|
||
the expected fields for a callback (code, author, valid…).</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler.get">
|
||
<code class="sig-name descname">get</code><span class="sig-paren">(</span><em class="sig-param">callback_name</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/callbackhandler.html#CallbackHandler.get"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler.get" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return the callbacks associated with this name.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>callback_name</strong> (<em>str</em>) – the name of the callback.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>A list of callbacks associated with this object and of this name.</p>
|
||
</dd>
|
||
</dl>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>This method returns a list of callback objects (namedtuple
|
||
representations). If the callback name cannot be found in the
|
||
object’s callbacks, return an empty list.</p>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler.get_variable">
|
||
<code class="sig-name descname">get_variable</code><span class="sig-paren">(</span><em class="sig-param">variable_name</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/callbackhandler.html#CallbackHandler.get_variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler.get_variable" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return the variable value or None.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>variable_name</strong> (<em>str</em>) – the name of the variable.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>Either the variable’s value or None.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler.remove">
|
||
<code class="sig-name descname">remove</code><span class="sig-paren">(</span><em class="sig-param">callback_name</em>, <em class="sig-param">number</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/callbackhandler.html#CallbackHandler.remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler.remove" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Delete the specified callback bound to this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>callback_name</strong> (<em>str</em>) – the name of the callback to delete.</p></li>
|
||
<li><p><strong>number</strong> (<em>int</em>) – the number of the callback to delete.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Raises</dt>
|
||
<dd class="field-even"><p><strong>RuntimeError if the callback is locked.</strong> – </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.callbackhandler.CallbackHandler.script">
|
||
<code class="sig-name descname">script</code><em class="property"> = None</em><a class="headerlink" href="#evennia.contrib.ingame_python.callbackhandler.CallbackHandler.script" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</div>
|
||
<div class="section" id="module-evennia.contrib.ingame_python.commands">
|
||
<span id="evennia-contrib-ingame-python-commands-module"></span><h2>evennia.contrib.ingame_python.commands module<a class="headerlink" href="#module-evennia.contrib.ingame_python.commands" title="Permalink to this headline">¶</a></h2>
|
||
<p>Module containing the commands of the in-game Python system.</p>
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.commands.</code><code class="sig-name descname">CmdCallback</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#CmdCallback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.html#evennia.commands.default.muxcommand.MuxCommand" title="evennia.commands.default.muxcommand.MuxCommand"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.muxcommand.MuxCommand</span></code></a></p>
|
||
<p>Command to edit callbacks.</p>
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback._keyaliases">
|
||
<code class="sig-name descname">_keyaliases</code><em class="property"> = ('@calls', '@callbacks', '@call', '@callback')</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback._keyaliases" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback._matchset">
|
||
<code class="sig-name descname">_matchset</code><em class="property"> = {'@call', '@callback', '@callbacks', '@calls'}</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback._matchset" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.accept_callback">
|
||
<code class="sig-name descname">accept_callback</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#CmdCallback.accept_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.accept_callback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Accept a callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.add_callback">
|
||
<code class="sig-name descname">add_callback</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#CmdCallback.add_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.add_callback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Add a callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.aliases">
|
||
<code class="sig-name descname">aliases</code><em class="property"> = ['@calls', '@callbacks', '@callback']</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.aliases" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.del_callback">
|
||
<code class="sig-name descname">del_callback</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#CmdCallback.del_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.del_callback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Delete a callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.edit_callback">
|
||
<code class="sig-name descname">edit_callback</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#CmdCallback.edit_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.edit_callback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Edit a callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.func">
|
||
<code class="sig-name descname">func</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#CmdCallback.func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.func" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Command body.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.get_help">
|
||
<code class="sig-name descname">get_help</code><span class="sig-paren">(</span><em class="sig-param">caller</em>, <em class="sig-param">cmdset</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#CmdCallback.get_help"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.get_help" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return the help message for this command and this caller.</p>
|
||
<p>The help text of this specific command will vary depending
|
||
on user permission.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>caller</strong> (<em>Object</em><em> or </em><em>Account</em>) – the caller asking for help on the command.</p></li>
|
||
<li><p><strong>cmdset</strong> (<a class="reference internal" href="evennia.commands.html#evennia.commands.cmdset.CmdSet" title="evennia.commands.cmdset.CmdSet"><em>CmdSet</em></a>) – the command set (if you need additional commands).</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>the help text to provide the caller for this command.</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>docstring (str)</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.help_category">
|
||
<code class="sig-name descname">help_category</code><em class="property"> = 'building'</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.help_category" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.key">
|
||
<code class="sig-name descname">key</code><em class="property"> = '@call'</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.key" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.list_callbacks">
|
||
<code class="sig-name descname">list_callbacks</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#CmdCallback.list_callbacks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.list_callbacks" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Display the list of callbacks connected to the object.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.list_tasks">
|
||
<code class="sig-name descname">list_tasks</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#CmdCallback.list_tasks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.list_tasks" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>List the active tasks.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.lock_storage">
|
||
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(developer)'</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.lock_storage" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.locks">
|
||
<code class="sig-name descname">locks</code><em class="property"> = 'cmd:perm(developer)'</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.locks" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.search_index_entry">
|
||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@calls @callbacks @callback', 'category': 'building', 'key': '@call', 'tags': '', 'text': '\n Command to edit callbacks.\n '}</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.commands._ev_load">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.commands.</code><code class="sig-name descname">_ev_load</code><span class="sig-paren">(</span><em class="sig-param">caller</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#_ev_load"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands._ev_load" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.commands._ev_quit">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.commands.</code><code class="sig-name descname">_ev_quit</code><span class="sig-paren">(</span><em class="sig-param">caller</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#_ev_quit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands._ev_quit" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.commands._ev_save">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.commands.</code><code class="sig-name descname">_ev_save</code><span class="sig-paren">(</span><em class="sig-param">caller</em>, <em class="sig-param">buf</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/commands.html#_ev_save"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.commands._ev_save" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Save and add the callback.</p>
|
||
</dd></dl>
|
||
|
||
</div>
|
||
<div class="section" id="module-evennia.contrib.ingame_python.eventfuncs">
|
||
<span id="evennia-contrib-ingame-python-eventfuncs-module"></span><h2>evennia.contrib.ingame_python.eventfuncs module<a class="headerlink" href="#module-evennia.contrib.ingame_python.eventfuncs" title="Permalink to this headline">¶</a></h2>
|
||
<p>Module defining basic eventfuncs for the event system.</p>
|
||
<p>Eventfuncs are just Python functions that can be used inside of calllbacks.</p>
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.eventfuncs.call_event">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.eventfuncs.</code><code class="sig-name descname">call_event</code><span class="sig-paren">(</span><em class="sig-param">obj</em>, <em class="sig-param">event_name</em>, <em class="sig-param">seconds=0</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/eventfuncs.html#call_event"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.eventfuncs.call_event" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Call the specified event in X seconds.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>obj</strong> (<em>Object</em>) – the typeclassed object containing the event.</p></li>
|
||
<li><p><strong>event_name</strong> (<em>str</em>) – the event name to be called.</p></li>
|
||
<li><p><strong>seconds</strong> (<em>int</em><em> or </em><em>float</em>) – the number of seconds to wait before calling
|
||
the event.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This eventfunc can be used to call other events from inside of an
|
||
event in a given time. This will create a pause between events. This
|
||
will not freeze the game, and you can expect characters to move
|
||
around (unless you prevent them from doing so).</p>
|
||
<p>Variables that are accessible in your event using ‘call()’ will be
|
||
kept and passed on to the event to call.</p>
|
||
<p>Chained callbacks are designed for this very purpose: they
|
||
are never called automatically by the game, rather, they need
|
||
to be called from inside another event.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.eventfuncs.deny">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.eventfuncs.</code><code class="sig-name descname">deny</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/eventfuncs.html#deny"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.eventfuncs.deny" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Deny, that is stop, the callback here.</p>
|
||
<p class="rubric">Notes</p>
|
||
<p>This function will raise an exception to terminate the callback
|
||
in a controlled way. If you use this function in an event called
|
||
prior to a command, the command will be cancelled as well. Good
|
||
situations to use the <cite>deny()</cite> function are in events that begins
|
||
by <cite>can_</cite>, because they usually can be cancelled as easily as that.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.eventfuncs.get">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.eventfuncs.</code><code class="sig-name descname">get</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/eventfuncs.html#get"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.eventfuncs.get" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return an object with the given search option or None if None is found.</p>
|
||
<dl class="simple">
|
||
<dt>Kwargs:</dt><dd><p>Any searchable data or property (id, db_key, db_location…).</p>
|
||
</dd>
|
||
</dl>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns</dt>
|
||
<dd class="field-odd"><p>The object found that meet these criteria for research, or
|
||
None if none is found.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This function is very useful to retrieve objects with a specific
|
||
ID. You know that room #32 exists, but you don’t have it in
|
||
the callback variables. Quite simple:</p>
|
||
<blockquote>
|
||
<div><p>room = get(id=32)</p>
|
||
</div></blockquote>
|
||
<p>This function doesn’t perform a search on objects, but a direct
|
||
search in the database. It’s recommended to use it for objects
|
||
you know exist, using their IDs or other unique attributes.
|
||
Looking for objects by key is possible (use <cite>db_key</cite> as an
|
||
argument) but remember several objects can share the same key.</p>
|
||
</dd></dl>
|
||
|
||
</div>
|
||
<div class="section" id="module-evennia.contrib.ingame_python.scripts">
|
||
<span id="evennia-contrib-ingame-python-scripts-module"></span><h2>evennia.contrib.ingame_python.scripts module<a class="headerlink" href="#module-evennia.contrib.ingame_python.scripts" title="Permalink to this headline">¶</a></h2>
|
||
<p>Scripts for the in-game Python system.</p>
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.scripts.</code><code class="sig-name descname">EventHandler</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.html#evennia.scripts.scripts.DefaultScript" title="evennia.scripts.scripts.DefaultScript"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript</span></code></a></p>
|
||
<p>The event handler that contains all events in a global script.</p>
|
||
<p>This script shouldn’t be created more than once. It contains
|
||
event (in a non-persistent attribute) and callbacks (in a
|
||
persistent attribute). The script method would help adding,
|
||
editing and deleting these events and callbacks.</p>
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DoesNotExist</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.MultipleObjectsReturned</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler._meta">
|
||
<code class="sig-name descname">_meta</code><em class="property"> = <Options for EventHandler></em><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler._meta" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.accept_callback">
|
||
<code class="sig-name descname">accept_callback</code><span class="sig-paren">(</span><em class="sig-param">obj</em>, <em class="sig-param">callback_name</em>, <em class="sig-param">number</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.accept_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.accept_callback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Valid a callback.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>obj</strong> (<em>Object</em>) – the object containing the callback.</p></li>
|
||
<li><p><strong>callback_name</strong> (<em>str</em>) – the name of the callback.</p></li>
|
||
<li><p><strong>number</strong> (<em>int</em>) – the number of the callback.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.add_callback">
|
||
<code class="sig-name descname">add_callback</code><span class="sig-paren">(</span><em class="sig-param">obj</em>, <em class="sig-param">callback_name</em>, <em class="sig-param">code</em>, <em class="sig-param">author=None</em>, <em class="sig-param">valid=False</em>, <em class="sig-param">parameters=''</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.add_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.add_callback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Add the specified callback.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>obj</strong> (<em>Object</em>) – the Evennia typeclassed object to be extended.</p></li>
|
||
<li><p><strong>callback_name</strong> (<em>str</em>) – the name of the callback to add.</p></li>
|
||
<li><p><strong>code</strong> (<em>str</em>) – the Python code associated with this callback.</p></li>
|
||
<li><p><strong>author</strong> (<em>Character</em><em> or </em><em>Account</em><em>, </em><em>optional</em>) – the author of the callback.</p></li>
|
||
<li><p><strong>valid</strong> (<em>bool</em><em>, </em><em>optional</em>) – should the callback be connected?</p></li>
|
||
<li><p><strong>parameters</strong> (<em>str</em><em>, </em><em>optional</em>) – optional parameters.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>This method doesn’t check that the callback type exists.</p>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.add_event">
|
||
<code class="sig-name descname">add_event</code><span class="sig-paren">(</span><em class="sig-param">typeclass</em>, <em class="sig-param">name</em>, <em class="sig-param">variables</em>, <em class="sig-param">help_text</em>, <em class="sig-param">custom_call</em>, <em class="sig-param">custom_add</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.add_event"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.add_event" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Add a new event for a defined typeclass.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>typeclass</strong> (<em>str</em>) – the path leading to the typeclass.</p></li>
|
||
<li><p><strong>name</strong> (<em>str</em>) – the name of the event to add.</p></li>
|
||
<li><p><strong>variables</strong> (<em>list of str</em>) – list of variable names for this event.</p></li>
|
||
<li><p><strong>help_text</strong> (<em>str</em>) – the long help text of the event.</p></li>
|
||
<li><p><strong>custom_call</strong> (<em>callable</em><em> or </em><em>None</em>) – the function to be called
|
||
when the event fires.</p></li>
|
||
<li><p><strong>custom_add</strong> (<em>callable</em><em> or </em><em>None</em>) – the function to be called when
|
||
a callback is added.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.at_script_creation">
|
||
<code class="sig-name descname">at_script_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.at_script_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.at_script_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Hook called when the script is created.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.at_start">
|
||
<code class="sig-name descname">at_start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.at_start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.at_start" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Set up the event system when starting.</p>
|
||
<p>Note that this hook is called every time the server restarts
|
||
(including when it’s reloaded). This hook performs the following
|
||
tasks:</p>
|
||
<ul class="simple">
|
||
<li><p>Create temporarily stored events.</p></li>
|
||
<li><p>Generate locals (individual events’ namespace).</p></li>
|
||
<li><p>Load eventfuncs, including user-defined ones.</p></li>
|
||
<li><p>Re-schedule tasks that aren’t set to fire anymore.</p></li>
|
||
<li><p>Effectively connect the handler to the main script.</p></li>
|
||
</ul>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.call">
|
||
<code class="sig-name descname">call</code><span class="sig-paren">(</span><em class="sig-param">obj</em>, <em class="sig-param">callback_name</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.call"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.call" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Call the connected callbacks.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>obj</strong> (<em>Object</em>) – the Evennia typeclassed object.</p></li>
|
||
<li><p><strong>callback_name</strong> (<em>str</em>) – the callback name to call.</p></li>
|
||
<li><p><strong>*args</strong> – additional variables for this callback.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<dl class="simple">
|
||
<dt>Kwargs:</dt><dd><p>number (int, optional): call just a specific callback.
|
||
parameters (str, optional): call a callback with parameters.
|
||
locals (dict, optional): a locals replacement.</p>
|
||
</dd>
|
||
</dl>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns</dt>
|
||
<dd class="field-odd"><p>True to report the callback was called without interruption,
|
||
False otherwise.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.del_callback">
|
||
<code class="sig-name descname">del_callback</code><span class="sig-paren">(</span><em class="sig-param">obj</em>, <em class="sig-param">callback_name</em>, <em class="sig-param">number</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.del_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.del_callback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Delete the specified callback.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>obj</strong> (<em>Object</em>) – the typeclassed object containing the callback.</p></li>
|
||
<li><p><strong>callback_name</strong> (<em>str</em>) – the name of the callback to delete.</p></li>
|
||
<li><p><strong>number</strong> (<em>int</em>) – the number of the callback to delete.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Raises</dt>
|
||
<dd class="field-even"><p><strong>RuntimeError if the callback is locked.</strong> – </p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.edit_callback">
|
||
<code class="sig-name descname">edit_callback</code><span class="sig-paren">(</span><em class="sig-param">obj</em>, <em class="sig-param">callback_name</em>, <em class="sig-param">number</em>, <em class="sig-param">code</em>, <em class="sig-param">author=None</em>, <em class="sig-param">valid=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.edit_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.edit_callback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Edit the specified callback.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>obj</strong> (<em>Object</em>) – the Evennia typeclassed object to be edited.</p></li>
|
||
<li><p><strong>callback_name</strong> (<em>str</em>) – the name of the callback to edit.</p></li>
|
||
<li><p><strong>number</strong> (<em>int</em>) – the callback number to be changed.</p></li>
|
||
<li><p><strong>code</strong> (<em>str</em>) – the Python code associated with this callback.</p></li>
|
||
<li><p><strong>author</strong> (<em>Character</em><em> or </em><em>Account</em><em>, </em><em>optional</em>) – the author of the callback.</p></li>
|
||
<li><p><strong>valid</strong> (<em>bool</em><em>, </em><em>optional</em>) – should the callback be connected?</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Raises</dt>
|
||
<dd class="field-even"><p><strong>RuntimeError if the callback is locked.</strong> – </p>
|
||
</dd>
|
||
</dl>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>This method doesn’t check that the callback type exists.</p>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.get_callbacks">
|
||
<code class="sig-name descname">get_callbacks</code><span class="sig-paren">(</span><em class="sig-param">obj</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.get_callbacks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.get_callbacks" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return a dictionary of the object’s callbacks.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>obj</strong> (<em>Object</em>) – the connected objects.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>A dictionary of the object’s callbacks.</p>
|
||
</dd>
|
||
</dl>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>This method can be useful to override in some contexts,
|
||
when several objects would share callbacks.</p>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.get_events">
|
||
<code class="sig-name descname">get_events</code><span class="sig-paren">(</span><em class="sig-param">obj</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.get_events"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.get_events" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return a dictionary of events on this object.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>obj</strong> (<em>Object</em><em> or </em><em>typeclass</em>) – the connected object or a general typeclass.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>A dictionary of the object’s events.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>Events would define what the object can have as
|
||
callbacks. Note, however, that chained callbacks will not
|
||
appear in events and are handled separately.</p>
|
||
<p>You can also request the events of a typeclass, not a
|
||
connected object. This is useful to get the global list
|
||
of events for a typeclass that has no object yet.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.get_variable">
|
||
<code class="sig-name descname">get_variable</code><span class="sig-paren">(</span><em class="sig-param">variable_name</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.get_variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.get_variable" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return the variable defined in the locals.</p>
|
||
<p>This can be very useful to check the value of a variable that can be modified in an event, and whose value will be used in code. This system allows additional customization.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>variable_name</strong> (<em>str</em>) – the name of the variable to return.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>The variable if found in the locals.
|
||
None if not found in the locals.</p>
|
||
</dd>
|
||
</dl>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>This will return the variable from the current locals.
|
||
Keep in mind that locals are shared between events. As
|
||
every event is called one by one, this doesn’t pose
|
||
additional problems if you get the variable right after
|
||
an event has been executed. If, however, you differ,
|
||
there’s no guarantee the variable will be here or will
|
||
mean the same thing.</p>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.handle_error">
|
||
<code class="sig-name descname">handle_error</code><span class="sig-paren">(</span><em class="sig-param">callback</em>, <em class="sig-param">trace</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.handle_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.handle_error" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Handle an error in a callback.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>callback</strong> (<em>dict</em>) – the callback representation.</p></li>
|
||
<li><p><strong>trace</strong> (<em>list</em>) – the traceback containing the exception.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This method can be useful to override to change the default
|
||
handling of errors. By default, the error message is sent to
|
||
the character who last updated the callback, if connected.
|
||
If not, display to the everror channel.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.ingame_python.scripts.EventHandler'</em><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.set_task">
|
||
<code class="sig-name descname">set_task</code><span class="sig-paren">(</span><em class="sig-param">seconds</em>, <em class="sig-param">obj</em>, <em class="sig-param">callback_name</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#EventHandler.set_task"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.set_task" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Set and schedule a task to run.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>seconds</strong> (<em>int</em><em>, </em><em>float</em>) – the delay in seconds from now.</p></li>
|
||
<li><p><strong>obj</strong> (<em>Object</em>) – the typecalssed object connected to the event.</p></li>
|
||
<li><p><strong>callback_name</strong> (<em>str</em>) – the callback’s name.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This method allows to schedule a “persistent” task.
|
||
‘utils.delay’ is called, but a copy of the task is kept in
|
||
the event handler, and when the script restarts (after reload),
|
||
the differed delay is called again.
|
||
The dictionary of locals is frozen and will be available
|
||
again when the task runs. This feature, however, is limited
|
||
by the database: all data cannot be saved. Lambda functions,
|
||
class methods, objects inside an instance and so on will
|
||
not be kept in the locals dictionary.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.scripts.EventHandler.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'EventHandler'</em><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.EventHandler.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.scripts.TimeEventScript">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.scripts.</code><code class="sig-name descname">TimeEventScript</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#TimeEventScript"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.TimeEventScript" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.html#evennia.scripts.scripts.DefaultScript" title="evennia.scripts.scripts.DefaultScript"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript</span></code></a></p>
|
||
<p>Gametime-sensitive script.</p>
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.scripts.TimeEventScript.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.TimeEventScript.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DoesNotExist</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.scripts.TimeEventScript.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.TimeEventScript.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.MultipleObjectsReturned</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.scripts.TimeEventScript._meta">
|
||
<code class="sig-name descname">_meta</code><em class="property"> = <Options for TimeEventScript></em><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.TimeEventScript._meta" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.TimeEventScript.at_repeat">
|
||
<code class="sig-name descname">at_repeat</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#TimeEventScript.at_repeat"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.TimeEventScript.at_repeat" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Call the event and reset interval.</p>
|
||
<p>It is necessary to restart the script to reset its interval
|
||
only twice after a reload. When the script has undergone
|
||
down time, there’s usually a slight shift in game time. Once
|
||
the script restarts once, it will set the average time it
|
||
needs for all its future intervals and should not need to be
|
||
restarted. In short, a script that is created shouldn’t need
|
||
to restart more than once, and a script that is reloaded should
|
||
restart only twice.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.scripts.TimeEventScript.at_script_creation">
|
||
<code class="sig-name descname">at_script_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#TimeEventScript.at_script_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.TimeEventScript.at_script_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The script is created.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.scripts.TimeEventScript.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.ingame_python.scripts.TimeEventScript'</em><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.TimeEventScript.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.scripts.TimeEventScript.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'TimeEventScript'</em><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.TimeEventScript.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.scripts.complete_task">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.scripts.</code><code class="sig-name descname">complete_task</code><span class="sig-paren">(</span><em class="sig-param">task_id</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/scripts.html#complete_task"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.scripts.complete_task" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Mark the task in the event handler as complete.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>task_id</strong> (<em>int</em>) – the task ID.</p>
|
||
</dd>
|
||
</dl>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>This function should be called automatically for individual tasks.</p>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
</div>
|
||
<div class="section" id="module-evennia.contrib.ingame_python.tests">
|
||
<span id="evennia-contrib-ingame-python-tests-module"></span><h2>evennia.contrib.ingame_python.tests module<a class="headerlink" href="#module-evennia.contrib.ingame_python.tests" title="Permalink to this headline">¶</a></h2>
|
||
<p>Module containing the test cases for the in-game Python system.</p>
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestCmdCallback">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.tests.</code><code class="sig-name descname">TestCmdCallback</code><span class="sig-paren">(</span><em class="sig-param">methodName='runTest'</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestCmdCallback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestCmdCallback" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.html#evennia.commands.default.tests.CommandTest" title="evennia.commands.default.tests.CommandTest"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.tests.CommandTest</span></code></a></p>
|
||
<p>Test the @callback command.</p>
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestCmdCallback.setUp">
|
||
<code class="sig-name descname">setUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestCmdCallback.setUp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestCmdCallback.setUp" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Create the callback handler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestCmdCallback.tearDown">
|
||
<code class="sig-name descname">tearDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestCmdCallback.tearDown"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestCmdCallback.tearDown" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Stop the callback handler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestCmdCallback.test_accept">
|
||
<code class="sig-name descname">test_accept</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestCmdCallback.test_accept"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestCmdCallback.test_accept" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Accept an callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestCmdCallback.test_add">
|
||
<code class="sig-name descname">test_add</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestCmdCallback.test_add"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestCmdCallback.test_add" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Test to add an callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestCmdCallback.test_del">
|
||
<code class="sig-name descname">test_del</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestCmdCallback.test_del"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestCmdCallback.test_del" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Add and remove an callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestCmdCallback.test_list">
|
||
<code class="sig-name descname">test_list</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestCmdCallback.test_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestCmdCallback.test_list" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Test listing callbacks with different rights.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestCmdCallback.test_lock">
|
||
<code class="sig-name descname">test_lock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestCmdCallback.test_lock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestCmdCallback.test_lock" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Test the lock of multiple editing.</p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestDefaultCallbacks">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.tests.</code><code class="sig-name descname">TestDefaultCallbacks</code><span class="sig-paren">(</span><em class="sig-param">methodName='runTest'</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestDefaultCallbacks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestDefaultCallbacks" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.html#evennia.commands.default.tests.CommandTest" title="evennia.commands.default.tests.CommandTest"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.tests.CommandTest</span></code></a></p>
|
||
<p>Test the default callbacks.</p>
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestDefaultCallbacks.setUp">
|
||
<code class="sig-name descname">setUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestDefaultCallbacks.setUp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestDefaultCallbacks.setUp" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Create the callback handler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestDefaultCallbacks.tearDown">
|
||
<code class="sig-name descname">tearDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestDefaultCallbacks.tearDown"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestDefaultCallbacks.tearDown" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Stop the callback handler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestDefaultCallbacks.test_exit">
|
||
<code class="sig-name descname">test_exit</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestDefaultCallbacks.test_exit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestDefaultCallbacks.test_exit" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Test the callbacks of an exit.</p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.tests.</code><code class="sig-name descname">TestEventHandler</code><span class="sig-paren">(</span><em class="sig-param">methodName='runTest'</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.utils.html#evennia.utils.test_resources.EvenniaTest" title="evennia.utils.test_resources.EvenniaTest"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.utils.test_resources.EvenniaTest</span></code></a></p>
|
||
<p>Test cases of the event handler to add, edit or delete events.</p>
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler.setUp">
|
||
<code class="sig-name descname">setUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler.setUp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler.setUp" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Create the event handler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler.tearDown">
|
||
<code class="sig-name descname">tearDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler.tearDown"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler.tearDown" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Stop the event handler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler.test_accept">
|
||
<code class="sig-name descname">test_accept</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler.test_accept"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler.test_accept" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Accept an callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler.test_add_validation">
|
||
<code class="sig-name descname">test_add_validation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler.test_add_validation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler.test_add_validation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Add a callback while needing validation.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler.test_call">
|
||
<code class="sig-name descname">test_call</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler.test_call"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler.test_call" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Test to call amore complex callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler.test_del">
|
||
<code class="sig-name descname">test_del</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler.test_del"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler.test_del" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Try to delete a callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler.test_edit">
|
||
<code class="sig-name descname">test_edit</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler.test_edit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler.test_edit" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Test editing a callback.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler.test_edit_validation">
|
||
<code class="sig-name descname">test_edit_validation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler.test_edit_validation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler.test_edit_validation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Edit a callback when validation isn’t automatic.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler.test_handler">
|
||
<code class="sig-name descname">test_handler</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler.test_handler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler.test_handler" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Test the object handler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.tests.TestEventHandler.test_start">
|
||
<code class="sig-name descname">test_start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/tests.html#TestEventHandler.test_start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.tests.TestEventHandler.test_start" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Simply make sure the handler runs with proper initial values.</p>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</div>
|
||
<div class="section" id="module-evennia.contrib.ingame_python.typeclasses">
|
||
<span id="evennia-contrib-ingame-python-typeclasses-module"></span><h2>evennia.contrib.ingame_python.typeclasses module<a class="headerlink" href="#module-evennia.contrib.ingame_python.typeclasses" title="Permalink to this headline">¶</a></h2>
|
||
<p>Typeclasses for the in-game Python system.</p>
|
||
<p>To use them, change your base typeclasses to inherit from the classes in this
|
||
module (EventObject, EventRoom, EventCharacter and EventExit) instead of the
|
||
default ones in evennia core.</p>
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.typeclasses.</code><code class="sig-name descname">EventCharacter</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.objects.html#evennia.objects.objects.DefaultCharacter" title="evennia.objects.objects.DefaultCharacter"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DefaultCharacter</span></code></a></p>
|
||
<p>Typeclass to represent a character and call event types.</p>
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DoesNotExist</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.MultipleObjectsReturned</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter._events">
|
||
<code class="sig-name descname">_events</code><em class="property"> = {'can_delete': (['character'], "\nCan the character be deleted?\nThis event is called before the character is deleted. You can use\n'deny()' in this event to prevent this character from being deleted.\nIf this event doesn't prevent the character from being deleted, its\n'delete' event is called right away.\n\nVariables you can use in this event:\n character: the character connected to this event.\n"), 'can_move': (['character', 'origin', 'destination'], "\nCan the character move?\nThis event is called before the character moves into another\nlocation. You can prevent the character from moving\nusing the 'deny()' eventfunc.\n\nVariables you can use in this event:\n character: the character connected to this event.\n origin: the current location of the character.\n destination: the future location of the character.\n"), 'can_part': (['character', 'departing'], "\nCan the departing charaacter leave this room?\nThis event is called before another character can move from the\nlocation where the current character also is. This event can be\nused to prevent someone to leave this room if, for instance, he/she\nhasn't paid, or he/she is going to a protected area, past a guard,\nand so on. Use 'deny()' to prevent the departing character from\nmoving.\n\nVariables you can use in this event:\n departing: the character who wants to leave this room.\n character: the character connected to this event.\n"), 'can_say': (['speaker', 'character', 'message'], '\nBefore another character can say something in the same location.\nThis event is called before another character says something in the\ncharacter\'s location. The "something" in question can be modified,\nor the action can be prevented by using \'deny()\'. To change the\ncontent of what the character says, simply change the variable\n\'message\' to another string of characters.\n\nVariables you can use in this event:\n speaker: the character who is using the say command.\n character: the character connected to this event.\n message: the text spoken by the character.\n', <function phrase_event>), 'delete': (['character'], "\nBefore deleting the character.\nThis event is called just before deleting this character. It shouldn't\nbe prevented (using the `deny()` function at this stage doesn't\nhave any effect). If you want to prevent deletion of this character,\nuse the event `can_delete` instead.\n\nVariables you can use in this event:\n character: the character connected to this event.\n"), 'greet': (['character', 'newcomer'], '\nA new character arrives in the location of this character.\nThis event is called when another character arrives in the location\nwhere the current character is. For instance, a puppeted character\narrives in the shop of a shopkeeper (assuming the shopkeeper is\na character). As its name suggests, this event can be very useful\nto have NPC greeting one another, or accounts, who come to visit.\n\nVariables you can use in this event:\n character: the character connected to this event.\n newcomer: the character arriving in the same location.\n'), 'move': (['character', 'origin', 'destination'], '\nAfter the character has moved into its new room.\nThis event is called when the character has moved into a new\nroom. It is too late to prevent the move at this point.\n\nVariables you can use in this event:\n character: the character connected to this event.\n origin: the old location of the character.\n destination: the new location of the character.\n'), 'puppeted': (['character'], '\nWhen the character has been puppeted by an account.\nThis event is called when an account has just puppeted this character.\nThis can commonly happen when an account connects onto this character,\nor when puppeting to a NPC or free character.\n\nVariables you can use in this event:\n character: the character connected to this event.\n'), 'say': (['speaker', 'character', 'message'], '\nAfter another character has said something in the character\'s room.\nThis event is called right after another character has said\nsomething in the same location.. The action cannot be prevented\nat this moment. Instead, this event is ideal to create keywords\nthat would trigger a character (like a NPC) in doing something\nif a specific phrase is spoken in the same location.\nTo use this event, you have to specify a list of keywords as\nparameters that should be present, as separate words, in the\nspoken phrase. For instance, you can set an event tthat would\nfire if the phrase spoken by the character contains "menu" or\n"dinner" or "lunch":\n @call/add ... = say menu, dinner, lunch\nThen if one of the words is present in what the character says,\nthis event will fire.\n\nVariables you can use in this event:\n speaker: the character speaking in this room.\n character: the character connected to this event.\n message: the text having been spoken by the character.\n', <function phrase_event>), 'time': (['character'], '\nA repeated event to be called regularly.\nThis event is scheduled to repeat at different times, specified\nas parameters. You can set it to run every day at 8:00 AM (game\ntime). You have to specify the time as an argument to @call/add, like:\n @call/add here = time 8:00\nThe parameter (8:00 here) must be a suite of digits separated by\nspaces, colons or dashes. Keep it as close from a recognizable\ndate format, like this:\n @call/add here = time 06-15 12:20\nThis event will fire every year on June the 15th at 12 PM (still\ngame time). Units have to be specified depending on your set calendar\n(ask a developer for more details).\n\nVariables you can use in this event:\n character: the character connected to this event.\n', None, <function time_event>), 'unpuppeted': (['character'], '\nWhen the character is about to be un-puppeted.\nThis event is called when an account is about to un-puppet the\ncharacter, which can happen if the account is disconnecting or\nchanging puppets.\n\nVariables you can use in this event:\n character: the character connected to this event.\n')}</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter._events" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter._meta">
|
||
<code class="sig-name descname">_meta</code><em class="property"> = <Options for EventCharacter></em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter._meta" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.announce_move_from">
|
||
<code class="sig-name descname">announce_move_from</code><span class="sig-paren">(</span><em class="sig-param">destination</em>, <em class="sig-param">msg=None</em>, <em class="sig-param">mapping=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter.announce_move_from"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.announce_move_from" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called if the move is to be announced. This is
|
||
called while we are still standing in the old
|
||
location.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>destination</strong> (<em>Object</em>) – The place we are going to.</p></li>
|
||
<li><p><strong>msg</strong> (<em>str</em><em>, </em><em>optional</em>) – a replacement message.</p></li>
|
||
<li><p><strong>mapping</strong> (<em>dict</em><em>, </em><em>optional</em>) – additional mapping objects.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>You can override this method and call its parent with a
|
||
message to simply change the default message. In the string,
|
||
you can use the following as mappings (between braces):</p>
|
||
<blockquote>
|
||
<div><p>object: the object which is moving.
|
||
exit: the exit from which the object is moving (if found).
|
||
origin: the location of the object before the move.
|
||
destination: the location of the object after moving.</p>
|
||
</div></blockquote>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.announce_move_to">
|
||
<code class="sig-name descname">announce_move_to</code><span class="sig-paren">(</span><em class="sig-param">source_location</em>, <em class="sig-param">msg=None</em>, <em class="sig-param">mapping=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter.announce_move_to"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.announce_move_to" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called after the move if the move was not quiet. At this point
|
||
we are standing in the new location.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>source_location</strong> (<em>Object</em>) – The place we came from</p></li>
|
||
<li><p><strong>msg</strong> (<em>str</em><em>, </em><em>optional</em>) – the replacement message if location.</p></li>
|
||
<li><p><strong>mapping</strong> (<em>dict</em><em>, </em><em>optional</em>) – additional mapping objects.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<p>You can override this method and call its parent with a
|
||
message to simply change the default message. In the string,
|
||
you can use the following as mappings (between braces):</p>
|
||
<blockquote>
|
||
<div><p>object: the object which is moving.
|
||
exit: the exit from which the object is moving (if found).
|
||
origin: the location of the object before the move.
|
||
destination: the location of the object after moving.</p>
|
||
</div></blockquote>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.at_after_move">
|
||
<code class="sig-name descname">at_after_move</code><span class="sig-paren">(</span><em class="sig-param">source_location</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter.at_after_move"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.at_after_move" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called after move has completed, regardless of quiet mode or
|
||
not. Allows changes to the object due to the location it is
|
||
now in.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>source_location</strong> (<em>Object</em>) – Wwhere we came from. This may be <cite>None</cite>.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.at_before_move">
|
||
<code class="sig-name descname">at_before_move</code><span class="sig-paren">(</span><em class="sig-param">destination</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter.at_before_move"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.at_before_move" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called just before starting to move this object to
|
||
destination.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>destination</strong> (<em>Object</em>) – The object we are moving to</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>If we should move or not.</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>shouldmove (bool)</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>If this method returns False/None, the move is cancelled
|
||
before it is even started.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.at_before_say">
|
||
<code class="sig-name descname">at_before_say</code><span class="sig-paren">(</span><em class="sig-param">message</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter.at_before_say"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.at_before_say" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Before the object says something.</p>
|
||
<p>This hook is by default used by the ‘say’ and ‘whisper’
|
||
commands as used by this command it is called before the text
|
||
is said/whispered and can be used to customize the outgoing
|
||
text from the object. Returning <cite>None</cite> aborts the command.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>message</strong> (<em>str</em>) – The suggested say/whisper text spoken by self.</p>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>Kwargs:</dt><dd><dl class="simple">
|
||
<dt>whisper (bool): If True, this is a whisper rather than</dt><dd><p>a say. This is sent by the whisper command by default.
|
||
Other verbal commands could use this hook in similar
|
||
ways.</p>
|
||
</dd>
|
||
</dl>
|
||
<p>receiver (Object): If set, this is a target for the say/whisper.</p>
|
||
</dd>
|
||
</dl>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Returns</dt>
|
||
<dd class="field-odd"><p>The (possibly modified) text to be spoken.</p>
|
||
</dd>
|
||
<dt class="field-even">Return type</dt>
|
||
<dd class="field-even"><p>message (str)</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.at_object_delete">
|
||
<code class="sig-name descname">at_object_delete</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter.at_object_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.at_object_delete" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called just before the database object is permanently
|
||
delete()d from the database. If this method returns False,
|
||
deletion is aborted.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.at_post_puppet">
|
||
<code class="sig-name descname">at_post_puppet</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter.at_post_puppet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.at_post_puppet" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called just after puppeting has been completed and all
|
||
Account<->Object links have been established.</p>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>You can use <cite>self.account</cite> and <cite>self.sessions.get()</cite> to get
|
||
account and sessions at this point; the last entry in the
|
||
list from <cite>self.sessions.get()</cite> is the latest Session
|
||
puppeting this Object.</p>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.at_pre_unpuppet">
|
||
<code class="sig-name descname">at_pre_unpuppet</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter.at_pre_unpuppet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.at_pre_unpuppet" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called just before beginning to un-connect a puppeting from
|
||
this Account.</p>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>You can use <cite>self.account</cite> and <cite>self.sessions.get()</cite> to get
|
||
account and sessions at this point; the last entry in the
|
||
list from <cite>self.sessions.get()</cite> is the latest Session
|
||
puppeting this Object.</p>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.at_say">
|
||
<code class="sig-name descname">at_say</code><span class="sig-paren">(</span><em class="sig-param">message</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter.at_say"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.at_say" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Display the actual say (or whisper) of self.</p>
|
||
<p>This hook should display the actual say/whisper of the object in its
|
||
location. It should both alert the object (self) and its
|
||
location that some text is spoken. The overriding of messages or
|
||
<cite>mapping</cite> allows for simple customization of the hook without
|
||
re-writing it completely.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>message</strong> (<em>str</em>) – The text to be conveyed by self.</p></li>
|
||
<li><p><strong>msg_self</strong> (<em>str</em><em>, </em><em>optional</em>) – The message to echo to self.</p></li>
|
||
<li><p><strong>msg_location</strong> (<em>str</em><em>, </em><em>optional</em>) – The message to echo to self’s location.</p></li>
|
||
<li><p><strong>receiver</strong> (<em>Object</em><em>, </em><em>optional</em>) – An eventual receiver of the message
|
||
(by default only used by whispers).</p></li>
|
||
<li><p><strong>msg_receiver</strong> (<em>str</em><em>, </em><em>optional</em>) – Specific message for receiver only.</p></li>
|
||
<li><p><strong>mapping</strong> (<em>dict</em><em>, </em><em>optional</em>) – Additional mapping in messages.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<dl class="simple">
|
||
<dt>Kwargs:</dt><dd><dl class="simple">
|
||
<dt>whisper (bool): If this is a whisper rather than a say. Kwargs</dt><dd><p>can be used by other verbal commands in a similar way.</p>
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>Messages can contain {} markers, which must
|
||
If used, <cite>msg_self</cite>, <cite>msg_receiver</cite> and <cite>msg_location</cite> should contain
|
||
references to other objects between braces, the way <cite>location.msg_contents</cite>
|
||
would allow. For instance:</p>
|
||
<blockquote>
|
||
<div><p>msg_self = ‘You say: “{speech}”’
|
||
msg_location = ‘{object} says: “{speech}”’
|
||
msg_receiver = ‘{object} whispers: “{speech}”’</p>
|
||
</div></blockquote>
|
||
<dl class="simple">
|
||
<dt>The following mappings can be used in both messages:</dt><dd><p>object: the object speaking.
|
||
location: the location where object is.
|
||
speech: the text spoken by self.</p>
|
||
</dd>
|
||
</dl>
|
||
<p>You can use additional mappings if you want to add other
|
||
information in your messages.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.callbacks">
|
||
<code class="sig-name descname">callbacks</code><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventCharacter.callbacks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.callbacks" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return the CallbackHandler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.ingame_python.typeclasses.EventCharacter'</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventCharacter.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'EventCharacter'</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventCharacter.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventExit">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.typeclasses.</code><code class="sig-name descname">EventExit</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventExit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventExit" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.objects.html#evennia.objects.objects.DefaultExit" title="evennia.objects.objects.DefaultExit"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DefaultExit</span></code></a></p>
|
||
<p>Modified exit including management of events.</p>
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventExit.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventExit.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DoesNotExist</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventExit.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventExit.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.MultipleObjectsReturned</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventExit._events">
|
||
<code class="sig-name descname">_events</code><em class="property"> = {'can_traverse': (['character', 'exit', 'room'], '\nCan the character traverse through this exit?\nThis event is called when a character is about to traverse this\nexit. You can use the deny() function to deny the character from\nexitting for this time.\n\nVariables you can use in this event:\n character: the character that wants to traverse this exit.\n exit: the exit to be traversed.\n room: the room in which stands the character before moving.\n'), 'msg_arrive': (['character', 'exit', 'origin', 'destination', 'message', 'mapping'], '\nCustomize the message when a character arrives through this exit.\nThis event is called when a character arrives through this exit.\nTo customize the message that will be sent to the room where the\ncharacter arrives, change the value of the variable "message"\nto give it your custom message. The character itself will not be\nnotified. You can use mapping between braces, like this:\n message = "{character} climbs out of a hole."\nIn your mapping, you can use {character} (the character who has\narrived), {exit} (the exit), {origin} (the room in which\nthe character was), and {destination} (the room in which the character\nnow is). If you need to customize the message with other information,\nyou can also set "message" to None and send something else instead.\n\nVariables you can use in this event:\n character: the character who is arriving through this exit.\n exit: the exit having been traversed.\n origin: the past location of the character.\n destination: the current location of the character.\n message: the message to be displayed in the destination.\n mapping: a dictionary containing the mapping of the message.\n'), 'msg_leave': (['character', 'exit', 'origin', 'destination', 'message', 'mapping'], '\nCustomize the message when a character leaves through this exit.\nThis event is called when a character leaves through this exit.\nTo customize the message that will be sent to the room where the\ncharacter came from, change the value of the variable "message"\nto give it your custom message. The character itself will not be\nnotified. You can use mapping between braces, like this:\n message = "{character} falls into a hole!"\nIn your mapping, you can use {character} (the character who is\nabout to leave), {exit} (the exit), {origin} (the room in which\nthe character is), and {destination} (the room in which the character\nis heading for). If you need to customize the message with other\ninformation, you can also set "message" to None and send something\nelse instead.\n\nVariables you can use in this event:\n character: the character who is leaving through this exit.\n exit: the exit being traversed.\n origin: the location of the character.\n destination: the destination of the character.\n message: the message to be displayed in the location.\n mapping: a dictionary containing additional mapping.\n'), 'time': (['exit'], '\nA repeated event to be called regularly.\nThis event is scheduled to repeat at different times, specified\nas parameters. You can set it to run every day at 8:00 AM (game\ntime). You have to specify the time as an argument to @call/add, like:\n @call/add north = time 8:00\nThe parameter (8:00 here) must be a suite of digits separated by\nspaces, colons or dashes. Keep it as close from a recognizable\ndate format, like this:\n @call/add south = time 06-15 12:20\nThis event will fire every year on June the 15th at 12 PM (still\ngame time). Units have to be specified depending on your set calendar\n(ask a developer for more details).\n\nVariables you can use in this event:\n exit: the exit connected to this event.\n', None, <function time_event>), 'traverse': (['character', 'exit', 'origin', 'destination'], "\nAfter the characer has traversed through this exit.\nThis event is called after a character has traversed through this\nexit. Traversing cannot be prevented using 'deny()' at this\npoint. The character will be in a different room and she will\nhave received the room's description when this event is called.\n\nVariables you can use in this event:\n character: the character who has traversed through this exit.\n exit: the exit that was just traversed through.\n origin: the exit's location (where the character was before moving).\n destination: the character's location after moving.\n")}</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventExit._events" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventExit._meta">
|
||
<code class="sig-name descname">_meta</code><em class="property"> = <Options for EventExit></em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventExit._meta" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventExit.at_traverse">
|
||
<code class="sig-name descname">at_traverse</code><span class="sig-paren">(</span><em class="sig-param">traversing_object</em>, <em class="sig-param">target_location</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventExit.at_traverse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventExit.at_traverse" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>This hook is responsible for handling the actual traversal,
|
||
normally by calling
|
||
<cite>traversing_object.move_to(target_location)</cite>. It is normally
|
||
only implemented by Exit objects. If it returns False (usually
|
||
because <cite>move_to</cite> returned False), <cite>at_after_traverse</cite> below
|
||
should not be called and instead <cite>at_failed_traverse</cite> should be
|
||
called.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>traversing_object</strong> (<em>Object</em>) – Object traversing us.</p></li>
|
||
<li><p><strong>target_location</strong> (<em>Object</em>) – Where target is going.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventExit.callbacks">
|
||
<code class="sig-name descname">callbacks</code><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventExit.callbacks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventExit.callbacks" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return the CallbackHandler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventExit.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.ingame_python.typeclasses.EventExit'</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventExit.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventExit.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'EventExit'</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventExit.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventObject">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.typeclasses.</code><code class="sig-name descname">EventObject</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventObject"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventObject" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.objects.html#evennia.objects.objects.DefaultObject" title="evennia.objects.objects.DefaultObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DefaultObject</span></code></a></p>
|
||
<p>Default object with management of events.</p>
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventObject.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventObject.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DoesNotExist</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventObject.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventObject.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.MultipleObjectsReturned</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventObject._events">
|
||
<code class="sig-name descname">_events</code><em class="property"> = {'drop': (['character', 'obj'], '\nWhen a character drops this object.\nThis event is called when a character drops this object. It is\ncalled after the command has ended and displayed its message, and\nthe action cannot be prevented at this time.\n\nVariables you can use in this event:\n character: the character having dropped the object.\n obj: the object connected to this event.\n'), 'get': (['character', 'obj'], '\nWhen a character gets this object.\nThis event is called when a character gets this object. It is\ncalled after the command has ended and displayed its message, and\nthe action cannot be prevented at this time.\n\nVariables you can use in this event:\n character: the character having picked up the object.\n obj: the object connected to this event.\n'), 'time': (['object'], '\nA repeated event to be called regularly.\nThis event is scheduled to repeat at different times, specified\nas parameters. You can set it to run every day at 8:00 AM (game\ntime). You have to specify the time as an argument to @call/add, like:\n @call/add here = time 8:00\nThe parameter (8:00 here) must be a suite of digits separated by\nspaces, colons or dashes. Keep it as close from a recognizable\ndate format, like this:\n @call/add here = time 06-15 12:20\nThis event will fire every year on June the 15th at 12 PM (still\ngame time). Units have to be specified depending on your set calendar\n(ask a developer for more details).\n\nVariables you can use in this event:\n object: the object connected to this event.\n', None, <function time_event>)}</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventObject._events" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventObject._meta">
|
||
<code class="sig-name descname">_meta</code><em class="property"> = <Options for EventObject></em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventObject._meta" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventObject.at_drop">
|
||
<code class="sig-name descname">at_drop</code><span class="sig-paren">(</span><em class="sig-param">dropper</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventObject.at_drop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventObject.at_drop" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called by the default <cite>drop</cite> command when this object has been
|
||
dropped.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>dropper</strong> (<em>Object</em>) – The object which just dropped this object.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This hook cannot stop the drop from happening. Use
|
||
permissions from that.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventObject.at_get">
|
||
<code class="sig-name descname">at_get</code><span class="sig-paren">(</span><em class="sig-param">getter</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventObject.at_get"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventObject.at_get" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called by the default <cite>get</cite> command when this object has been
|
||
picked up.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>getter</strong> (<em>Object</em>) – The object getting this object.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This hook cannot stop the pickup from happening. Use
|
||
permissions for that.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventObject.callbacks">
|
||
<code class="sig-name descname">callbacks</code><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventObject.callbacks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventObject.callbacks" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return the CallbackHandler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventObject.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.ingame_python.typeclasses.EventObject'</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventObject.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventObject.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'EventObject'</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventObject.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="class">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventRoom">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.typeclasses.</code><code class="sig-name descname">EventRoom</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventRoom"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventRoom" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.objects.html#evennia.objects.objects.DefaultRoom" title="evennia.objects.objects.DefaultRoom"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DefaultRoom</span></code></a></p>
|
||
<p>Default room with management of events.</p>
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventRoom.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventRoom.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.DoesNotExist</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventRoom.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventRoom.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.objects.objects.MultipleObjectsReturned</span></code></p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventRoom._events">
|
||
<code class="sig-name descname">_events</code><em class="property"> = {'can_delete': (['room'], "\nCan the room be deleted?\nThis event is called before the room is deleted. You can use\n'deny()' in this event to prevent this room from being deleted.\nIf this event doesn't prevent the room from being deleted, its\n'delete' event is called right away.\n\nVariables you can use in this event:\n room: the room connected to this event.\n"), 'can_move': (['character', 'room'], "\nCan the character move into this room?\nThis event is called before the character can move into this\nspecific room. You can prevent the move by using the 'deny()'\nfunction.\n\nVariables you can use in this event:\n character: the character who wants to move in this room.\n room: the room connected to this event.\n"), 'can_say': (['character', 'room', 'message'], '\nBefore a character can say something in this room.\nThis event is called before a character says something in this\nroom. The "something" in question can be modified, or the action\ncan be prevented by using \'deny()\'. To change the content of what\nthe character says, simply change the variable \'message\' to another\nstring of characters.\n\nVariables you can use in this event:\n character: the character who is using the say command.\n room: the room connected to this event.\n message: the text spoken by the character.\n', <function phrase_event>), 'delete': (['room'], "\nBefore deleting the room.\nThis event is called just before deleting this room. It shouldn't\nbe prevented (using the `deny()` function at this stage doesn't\nhave any effect). If you want to prevent deletion of this room,\nuse the event `can_delete` instead.\n\nVariables you can use in this event:\n room: the room connected to this event.\n"), 'move': (['character', 'origin', 'destination'], '\nAfter the character has moved into this room.\nThis event is called when the character has moved into this\nroom. It is too late to prevent the move at this point.\n\nVariables you can use in this event:\n character: the character connected to this event.\n origin: the old location of the character.\n destination: the new location of the character.\n'), 'puppeted_in': (['character', 'room'], "\nAfter the character has been puppeted in this room.\nThis event is called after a character has been puppeted in this\nroom. This can happen when an account, having connected, begins\nto puppet a character. The character's location at this point,\nif it's a room, will see this event fire.\n\nVariables you can use in this event:\n character: the character who have just been puppeted in this room.\n room: the room connected to this event.\n"), 'say': (['character', 'room', 'message'], '\nAfter the character has said something in the room.\nThis event is called right after a character has said something\nin this room. The action cannot be prevented at this moment.\nInstead, this event is ideal to create actions that will respond\nto something being said aloud. To use this event, you have to\nspecify a list of keywords as parameters that should be present,\nas separate words, in the spoken phrase. For instance, you can\nset an event tthat would fire if the phrase spoken by the character\ncontains "menu" or "dinner" or "lunch":\n @call/add ... = say menu, dinner, lunch\nThen if one of the words is present in what the character says,\nthis event will fire.\n\nVariables you can use in this event:\n character: the character having spoken in this room.\n room: the room connected to this event.\n message: the text having been spoken by the character.\n', <function phrase_event>), 'time': (['room'], '\nA repeated event to be called regularly.\nThis event is scheduled to repeat at different times, specified\nas parameters. You can set it to run every day at 8:00 AM (game\ntime). You have to specify the time as an argument to @call/add, like:\n @call/add here = time 8:00\nThe parameter (8:00 here) must be a suite of digits separated by\nspaces, colons or dashes. Keep it as close from a recognizable\ndate format, like this:\n @call/add here = time 06-15 12:20\nThis event will fire every year on June the 15th at 12 PM (still\ngame time). Units have to be specified depending on your set calendar\n(ask a developer for more details).\n\nVariables you can use in this event:\n room: the room connected to this event.\n', None, <function time_event>), 'unpuppeted_in': (['character', 'room'], "\nBefore the character is un-puppeted in this room.\nThis event is called before a character is un-puppeted in this\nroom. This can happen when an account, puppeting a character, is\ndisconnecting. The character's location at this point, if it's a\nroom, will see this event fire.\n\nVariables you can use in this event:\n character: the character who is about to be un-puppeted in this room.\n room: the room connected to this event.\n")}</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventRoom._events" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventRoom._meta">
|
||
<code class="sig-name descname">_meta</code><em class="property"> = <Options for EventRoom></em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventRoom._meta" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventRoom.at_object_delete">
|
||
<code class="sig-name descname">at_object_delete</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventRoom.at_object_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventRoom.at_object_delete" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called just before the database object is permanently
|
||
delete()d from the database. If this method returns False,
|
||
deletion is aborted.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventRoom.callbacks">
|
||
<code class="sig-name descname">callbacks</code><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/typeclasses.html#EventRoom.callbacks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventRoom.callbacks" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return the CallbackHandler.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventRoom.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.ingame_python.typeclasses.EventRoom'</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventRoom.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.contrib.ingame_python.typeclasses.EventRoom.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'EventRoom'</em><a class="headerlink" href="#evennia.contrib.ingame_python.typeclasses.EventRoom.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</div>
|
||
<div class="section" id="module-evennia.contrib.ingame_python.utils">
|
||
<span id="evennia-contrib-ingame-python-utils-module"></span><h2>evennia.contrib.ingame_python.utils module<a class="headerlink" href="#module-evennia.contrib.ingame_python.utils" title="Permalink to this headline">¶</a></h2>
|
||
<p>Functions to extend the event system.</p>
|
||
<p>These functions are to be used by developers to customize events and callbacks.</p>
|
||
<dl class="exception">
|
||
<dt id="evennia.contrib.ingame_python.utils.InterruptEvent">
|
||
<em class="property">exception </em><code class="sig-prename descclassname">evennia.contrib.ingame_python.utils.</code><code class="sig-name descname">InterruptEvent</code><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/utils.html#InterruptEvent"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.utils.InterruptEvent" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">RuntimeError</span></code></p>
|
||
<p>Interrupt the current event.</p>
|
||
<p>You shouldn’t have to use this exception directly, probably use the
|
||
<cite>deny()</cite> function that handles it instead.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.utils.get_event_handler">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.utils.</code><code class="sig-name descname">get_event_handler</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/utils.html#get_event_handler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.utils.get_event_handler" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Return the event handler or None.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.utils.get_next_wait">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.utils.</code><code class="sig-name descname">get_next_wait</code><span class="sig-paren">(</span><em class="sig-param">format</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/utils.html#get_next_wait"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.utils.get_next_wait" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Get the length of time in seconds before format.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>format</strong> (<em>str</em>) – a time format matching the set calendar.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>the number of seconds until the event.
|
||
usual (int or float): the usual number of seconds between events.
|
||
format (str): a string format representing the time.</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>until (int or float)</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>The time format could be something like “2018-01-08 12:00”. The
|
||
number of units set in the calendar affects the way seconds are
|
||
calculated.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.utils.keyword_event">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.utils.</code><code class="sig-name descname">keyword_event</code><span class="sig-paren">(</span><em class="sig-param">callbacks</em>, <em class="sig-param">parameters</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/utils.html#keyword_event"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.utils.keyword_event" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Custom call for events with keywords (like push, or pull, or turn…).</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>callbacks</strong> (<em>list of dict</em>) – the list of callbacks to be called.</p></li>
|
||
<li><p><strong>parameters</strong> (<em>str</em>) – the actual parameters entered to trigger the callback.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>A list containing the callback dictionaries to be called.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This function should be imported and added as a custom_call
|
||
parameter to add the event when the event supports keywords
|
||
as parameters. Keywords in parameters are one or more words
|
||
separated by a comma. For instance, a ‘push 1, one’ callback can
|
||
be set to trigger when the player ‘push 1’ or ‘push one’.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.utils.phrase_event">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.utils.</code><code class="sig-name descname">phrase_event</code><span class="sig-paren">(</span><em class="sig-param">callbacks</em>, <em class="sig-param">parameters</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/utils.html#phrase_event"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.utils.phrase_event" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Custom call for events with keywords in sentences (like say or whisper).</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>callbacks</strong> (<em>list of dict</em>) – the list of callbacks to be called.</p></li>
|
||
<li><p><strong>parameters</strong> (<em>str</em>) – the actual parameters entered to trigger the callback.</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>A list containing the callback dictionaries to be called.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This function should be imported and added as a custom_call
|
||
parameter to add the event when the event supports keywords
|
||
in phrases as parameters. Keywords in parameters are one or more
|
||
words separated by a comma. For instance, a ‘say yes, okay’ callback
|
||
can be set to trigger when the player says something containing
|
||
either “yes” or “okay” (maybe ‘say I don’t like it, but okay’).</p>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.utils.register_events">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.utils.</code><code class="sig-name descname">register_events</code><span class="sig-paren">(</span><em class="sig-param">path_or_typeclass</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/utils.html#register_events"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.utils.register_events" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Register the events in this typeclass.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>path_or_typeclass</strong> (<em>str</em><em> or </em><em>type</em>) – the Python path leading to the
|
||
class containing events, or the class itself.</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>The typeclass itself.</p>
|
||
</dd>
|
||
</dl>
|
||
<p class="rubric">Notes</p>
|
||
<p>This function will read events from the <cite>_events</cite> class variable
|
||
defined in the typeclass given in parameters. It will add
|
||
the events, either to the script if it exists, or to some
|
||
temporary storage, waiting for the script to be initialized.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="evennia.contrib.ingame_python.utils.time_event">
|
||
<code class="sig-prename descclassname">evennia.contrib.ingame_python.utils.</code><code class="sig-name descname">time_event</code><span class="sig-paren">(</span><em class="sig-param">obj</em>, <em class="sig-param">event_name</em>, <em class="sig-param">number</em>, <em class="sig-param">parameters</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/ingame_python/utils.html#time_event"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.ingame_python.utils.time_event" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Create a time-related event.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>obj</strong> (<em>Object</em>) – the object on which sits the event.</p></li>
|
||
<li><p><strong>event_name</strong> (<em>str</em>) – the event’s name.</p></li>
|
||
<li><p><strong>number</strong> (<em>int</em>) – the number of the event.</p></li>
|
||
<li><p><strong>parameters</strong> (<em>str</em>) – the parameter of the event.</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3 id="searchlabel">Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="../search.html" method="get">
|
||
<input type="text" name="q" aria-labelledby="searchlabel" />
|
||
<input type="submit" value="Go" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script>$('#searchbox').show(0);</script>
|
||
<p><h3><a href="../index.html">Table of Contents</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">evennia.contrib.ingame_python package</a><ul>
|
||
<li><a class="reference internal" href="#submodules">Submodules</a></li>
|
||
<li><a class="reference internal" href="#module-evennia.contrib.ingame_python.callbackhandler">evennia.contrib.ingame_python.callbackhandler module</a></li>
|
||
<li><a class="reference internal" href="#module-evennia.contrib.ingame_python.commands">evennia.contrib.ingame_python.commands module</a></li>
|
||
<li><a class="reference internal" href="#module-evennia.contrib.ingame_python.eventfuncs">evennia.contrib.ingame_python.eventfuncs module</a></li>
|
||
<li><a class="reference internal" href="#module-evennia.contrib.ingame_python.scripts">evennia.contrib.ingame_python.scripts module</a></li>
|
||
<li><a class="reference internal" href="#module-evennia.contrib.ingame_python.tests">evennia.contrib.ingame_python.tests module</a></li>
|
||
<li><a class="reference internal" href="#module-evennia.contrib.ingame_python.typeclasses">evennia.contrib.ingame_python.typeclasses module</a></li>
|
||
<li><a class="reference internal" href="#module-evennia.contrib.ingame_python.utils">evennia.contrib.ingame_python.utils module</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
<div class="relations">
|
||
<h3>Related Topics</h3>
|
||
<ul>
|
||
<li><a href="../index.html">Documentation overview</a><ul>
|
||
</ul></li>
|
||
</ul>
|
||
</div>
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../_sources/api/evennia.contrib.ingame_python.rst.txt"
|
||
rel="nofollow">Show Page Source</a></li>
|
||
</ul>
|
||
</div>
|
||
<h3>Versions</h3>
|
||
<ul>
|
||
<li><a href="evennia.contrib.ingame_python.html">1.0-dev (develop branch)</a></li>
|
||
<li><a href="../../0.9.1/api/evennia.contrib.ingame_python.html">0.9.1 (master branch)</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="footer">
|
||
©2020, The Evennia developer community.
|
||
|
||
|
|
||
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.4.4</a>
|
||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||
|
||
|
|
||
<a href="../_sources/api/evennia.contrib.ingame_python.rst.txt"
|
||
rel="nofollow">Page source</a>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</body>
|
||
</html> |