mirror of
https://github.com/evennia/evennia.git
synced 2026-03-18 22:06:30 +01:00
444 lines
No EOL
40 KiB
HTML
444 lines
No EOL
40 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<title>evennia.contrib.tutorial_examples.red_button_scripts — Evennia 1.0-dev documentation</title>
|
||
<link rel="stylesheet" href="../_static/nature.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="shortcut icon" href="../_static/favicon.ico"/>
|
||
<link rel="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Search" href="../search.html" />
|
||
</head><body>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="General Index"
|
||
accesskey="I">index</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">evennia.contrib.tutorial_examples.red_button_scripts</a></li>
|
||
</ul>
|
||
<div class="develop">develop branch</div>
|
||
</div>
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<div class="section" id="module-evennia.contrib.tutorial_examples.red_button_scripts">
|
||
<span id="evennia-contrib-tutorial-examples-red-button-scripts"></span><h1>evennia.contrib.tutorial_examples.red_button_scripts<a class="headerlink" href="#module-evennia.contrib.tutorial_examples.red_button_scripts" title="Permalink to this headline">¶</a></h1>
|
||
<p>Example of scripts.</p>
|
||
<p>These are scripts intended for a particular object - the
|
||
red_button object type in contrib/examples. A few variations
|
||
on uses of scripts are included.</p>
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_examples.red_button_scripts.</code><code class="sig-name descname">ClosedLidState</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#ClosedLidState"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.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>This manages the cmdset for the “closed” button state. What this
|
||
means is that while this script is valid, we add the RedButtonClosed
|
||
cmdset to it (with commands like open, nudge lid etc)</p>
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.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/tutorial_examples/red_button_scripts.html#ClosedLidState.at_script_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.at_script_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called when script first created.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.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/tutorial_examples/red_button_scripts.html#ClosedLidState.at_start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.at_start" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>This is called once every server restart, so we want to add the
|
||
(memory-resident) cmdset to the object here. is_valid is automatically
|
||
checked so we don’t need to worry about adding the script to an
|
||
open lid.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.is_valid">
|
||
<code class="sig-name descname">is_valid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#ClosedLidState.is_valid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.is_valid" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The script is only valid while the lid is closed.
|
||
self.obj is the red_button on which this script is defined.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.at_stop">
|
||
<code class="sig-name descname">at_stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#ClosedLidState.at_stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.at_stop" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>When the script stops we must make sure to clean up after us.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.DoesNotExist" title="evennia.scripts.scripts.DefaultScript.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.DoesNotExist</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned" title="evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'ClosedLidState'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.ClosedLidState.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_examples.red_button_scripts.</code><code class="sig-name descname">OpenLidState</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#OpenLidState"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.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>This manages the cmdset for the “open” button state. This will add
|
||
the RedButtonOpen</p>
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.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/tutorial_examples/red_button_scripts.html#OpenLidState.at_script_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.at_script_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called when script first created.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.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/tutorial_examples/red_button_scripts.html#OpenLidState.at_start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.at_start" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>This is called once every server restart, so we want to add the
|
||
(memory-resident) cmdset to the object here. is_valid is
|
||
automatically checked, so we don’t need to worry about
|
||
adding the cmdset to a closed lid-button.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.is_valid">
|
||
<code class="sig-name descname">is_valid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#OpenLidState.is_valid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.is_valid" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The script is only valid while the lid is open.
|
||
self.obj is the red_button on which this script is defined.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.at_stop">
|
||
<code class="sig-name descname">at_stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#OpenLidState.at_stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.at_stop" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>When the script stops (like if the lid is closed again)
|
||
we must make sure to clean up after us.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.DoesNotExist" title="evennia.scripts.scripts.DefaultScript.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.DoesNotExist</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned" title="evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'OpenLidState'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.OpenLidState.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlindedState">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_examples.red_button_scripts.</code><code class="sig-name descname">BlindedState</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#BlindedState"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlindedState" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.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>This is a timed state.</p>
|
||
<p>This adds a (very limited) cmdset TO THE ACCOUNT, during a certain time,
|
||
after which the script will close and all functions are
|
||
restored. It’s up to the function starting the script to actually
|
||
set it on the right account object.</p>
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.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/tutorial_examples/red_button_scripts.html#BlindedState.at_script_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.at_script_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>We set up the script here.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.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/tutorial_examples/red_button_scripts.html#BlindedState.at_start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.at_start" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>We want to add the cmdset to the linked object.</p>
|
||
<p>Note that the RedButtonBlind cmdset is defined to completly
|
||
replace the other cmdsets on the stack while it is active
|
||
(this means that while blinded, only operations in this cmdset
|
||
will be possible for the account to perform). It is however
|
||
not persistent, so should there be a bug in it, we just need
|
||
to restart the server to clear out of it during development.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.at_stop">
|
||
<code class="sig-name descname">at_stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#BlindedState.at_stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.at_stop" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>It’s important that we clear out that blinded cmdset
|
||
when we are done!</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.DoesNotExist" title="evennia.scripts.scripts.DefaultScript.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.DoesNotExist</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned" title="evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.tutorial_examples.red_button_scripts.BlindedState'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'BlindedState'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlindedState.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_examples.red_button_scripts.</code><code class="sig-name descname">CloseLidEvent</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#CloseLidEvent"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.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>This event closes the glass lid over the button
|
||
some time after it was opened. It’s a one-off
|
||
script that should be started/created when the
|
||
lid is opened.</p>
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.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/tutorial_examples/red_button_scripts.html#CloseLidEvent.at_script_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.at_script_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called when script object is first created. Sets things up.
|
||
We want to have a lid on the button that the user can pull
|
||
aside in order to make the button ‘pressable’. But after a set
|
||
time that lid should auto-close again, making the button safe
|
||
from pressing (and deleting this command).</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.is_valid">
|
||
<code class="sig-name descname">is_valid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#CloseLidEvent.is_valid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.is_valid" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>This script can only operate if the lid is open; if it
|
||
is already closed, the script is clearly invalid.</p>
|
||
<p>Note that we are here relying on an self.obj being
|
||
defined (and being a RedButton object) - this we should be able to
|
||
expect since this type of script is always tied to one individual
|
||
red button object and not having it would be an error.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.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/tutorial_examples/red_button_scripts.html#CloseLidEvent.at_repeat"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.at_repeat" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called after self.interval seconds. It closes the lid. Before this method is
|
||
called, self.is_valid() is automatically checked, so there is no need to
|
||
check this manually.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.DoesNotExist" title="evennia.scripts.scripts.DefaultScript.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.DoesNotExist</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned" title="evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'CloseLidEvent'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.CloseLidEvent.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_examples.red_button_scripts.</code><code class="sig-name descname">BlinkButtonEvent</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#BlinkButtonEvent"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.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>This timed script lets the button flash at regular intervals.</p>
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.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/tutorial_examples/red_button_scripts.html#BlinkButtonEvent.at_script_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.at_script_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Sets things up. We want the button’s lamp to blink at
|
||
regular intervals, unless it’s broken (can happen
|
||
if you try to smash the glass, say).</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.is_valid">
|
||
<code class="sig-name descname">is_valid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#BlinkButtonEvent.is_valid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.is_valid" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Button will keep blinking unless it is broken.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.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/tutorial_examples/red_button_scripts.html#BlinkButtonEvent.at_repeat"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.at_repeat" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Called every self.interval seconds. Makes the lamp in
|
||
the button blink.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.DoesNotExist" title="evennia.scripts.scripts.DefaultScript.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.DoesNotExist</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned" title="evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'BlinkButtonEvent'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.BlinkButtonEvent.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="py class">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_examples.red_button_scripts.</code><code class="sig-name descname">DeactivateButtonEvent</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_examples/red_button_scripts.html#DeactivateButtonEvent"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.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>This deactivates the button for a short while (it won’t blink, won’t
|
||
close its lid etc). It is meant to be called when the button is pushed
|
||
and run as long as the blinded effect lasts. We cannot put these methods
|
||
in the AddBlindedCmdSet script since that script is defined on the <em>account</em>
|
||
whereas this one must be defined on the <em>button</em>.</p>
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.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/tutorial_examples/red_button_scripts.html#DeactivateButtonEvent.at_script_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.at_script_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Sets things up.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.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/tutorial_examples/red_button_scripts.html#DeactivateButtonEvent.at_start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.at_start" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Deactivate the button. Observe that this method is always
|
||
called directly, regardless of the value of self.start_delay
|
||
(that just controls when at_repeat() is called)</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py method">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.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/tutorial_examples/red_button_scripts.html#DeactivateButtonEvent.at_repeat"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.at_repeat" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>When this is called, reset the functionality of the button.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.DoesNotExist">
|
||
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.DoesNotExist" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.DoesNotExist" title="evennia.scripts.scripts.DefaultScript.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.DoesNotExist</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py exception">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.MultipleObjectsReturned">
|
||
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.MultipleObjectsReturned" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.scripts.scripts.html#evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned" title="evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.scripts.scripts.DefaultScript.MultipleObjectsReturned</span></code></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt id="evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.typename">
|
||
<code class="sig-name descname">typename</code><em class="property"> = 'DeactivateButtonEvent'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.red_button_scripts.DeactivateButtonEvent.typename" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</div>
|
||
|
||
|
||
<div class="clearer"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<p class="logo"><a href="../index.html">
|
||
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
|
||
</a></p>
|
||
<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>
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../_sources/api/evennia.contrib.tutorial_examples.red_button_scripts.rst.txt"
|
||
rel="nofollow">Show Page Source</a></li>
|
||
</ul>
|
||
</div>
|
||
<h3>Versions</h3>
|
||
<ul>
|
||
<li><a href="evennia.contrib.tutorial_examples.red_button_scripts.html">1.0-dev (develop branch)</a></li>
|
||
<li><a href="../../0.9.5/api/evennia.contrib.tutorial_examples.red_button_scripts.html">0.9.5 (v0.9.5 branch)</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="General Index"
|
||
>index</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">evennia.contrib.tutorial_examples.red_button_scripts</a></li>
|
||
</ul>
|
||
<div class="develop">develop branch</div>
|
||
</div>
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2020, The Evennia developer community.
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
|
||
</div>
|
||
</body>
|
||
</html> |