<spanid="evennia-contrib-base-systems-ingame-python-eventfuncs"></span><h1>evennia.contrib.base_systems.ingame_python.eventfuncs<aclass="headerlink"href="#module-evennia.contrib.base_systems.ingame_python.eventfuncs"title="Permalink to this headline">¶</a></h1>
<p>Module defining basic eventfuncs for the event system.</p>
<p>Eventfuncs are just Python functions that can be used inside of calllbacks.</p>
<codeclass="sig-prename descclassname">evennia.contrib.base_systems.ingame_python.eventfuncs.</code><codeclass="sig-name descname">deny</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/base_systems/ingame_python/eventfuncs.html#deny"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.base_systems.ingame_python.eventfuncs.deny"title="Permalink to this definition">¶</a></dt>
<dd><p>Deny, that is stop, the callback here.</p>
<pclass="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 <strong>deny()</strong> function are in events that begins
by <strong>can_</strong>, because they usually can be cancelled as easily as that.</p>
<codeclass="sig-prename descclassname">evennia.contrib.base_systems.ingame_python.eventfuncs.</code><codeclass="sig-name descname">get</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/base_systems/ingame_python/eventfuncs.html#get"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.base_systems.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>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><p><strong>searchable data</strong><strong> or </strong><strong>property</strong> (<em>Any</em>) –</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>The object found that meet these criteria for research, or
None if none is found.</p>
</dd>
</dl>
<pclass="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 <strong>db_key</strong> as an
argument) but remember several objects can share the same key.</p>
<codeclass="sig-prename descclassname">evennia.contrib.base_systems.ingame_python.eventfuncs.</code><codeclass="sig-name descname">call_event</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">obj</span></em>, <emclass="sig-param"><spanclass="n">event_name</span></em>, <emclass="sig-param"><spanclass="n">seconds</span><spanclass="o">=</span><spanclass="default_value">0</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/base_systems/ingame_python/eventfuncs.html#call_event"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.base_systems.ingame_python.eventfuncs.call_event"title="Permalink to this definition">¶</a></dt>
<dd><p>Call the specified event in X seconds.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="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>
<pclass="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