<h1>Batch processor examples<aclass="headerlink"href="#batch-processor-examples"title="Permalink to this headline">¶</a></h1>
<p>Contibution by Griatch, 2012</p>
<p>Simple examples for the batch-processor. The batch processor is used for generating
in-game content from one or more static files. Files can be stored with version
control and then ‘applied’ to the game to create content.</p>
<p>There are two batch processor types:</p>
<ulclass="simple">
<li><p>Batch-cmd processor: A list of <codeclass="docutils literal notranslate"><spanclass="pre">#</span></code>-separated Evennia commands being executed
in sequence, such as <codeclass="docutils literal notranslate"><spanclass="pre">create</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">dig</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">north</span></code> etc. When running a script
of this type (filename ending with <codeclass="docutils literal notranslate"><spanclass="pre">.ev</span></code>), the caller of the script will be
the one performing the script’s actions.</p></li>
<li><p>Batch-code processor: A full Python script (filename ending with <codeclass="docutils literal notranslate"><spanclass="pre">.py</span></code> that
executes Evennia api calls to build, such as <codeclass="docutils literal notranslate"><spanclass="pre">evennia.create_object</span></code> or
<codeclass="docutils literal notranslate"><spanclass="pre">evennia.search_object</span></code> etc. It can be divided up into comment-separated
chunks so one can execute only parts of the script at a time (in this way it’s
a little different than a normal Python file).</p></li>
</ul>
<sectionid="usage">
<h2>Usage<aclass="headerlink"href="#usage"title="Permalink to this headline">¶</a></h2>
<p>To test the two example batch files, you need <codeclass="docutils literal notranslate"><spanclass="pre">Developer</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">superuser</span></code>
permissions, be logged into the game and run of</p>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">/interactive</span></code> drops you in interactive mode so you can follow along what
the scripts do. Skip it to build it all at once.</p>
<p>Both commands produce the same results - they create a red-button object,
a table and a chair. If you run either with the <codeclass="docutils literal notranslate"><spanclass="pre">/debug</span></code> switch, the objects will
be deleted afterwards (for quick tests of syntax that you don’t want to spam new
objects, for example).</p>
<hrclass="docutils"/>
<p><small>This document page is generated from <codeclass="docutils literal notranslate"><spanclass="pre">evennia/contrib/tutorials/batchprocessor/README.md</span></code>. Changes to this
file will be overwritten, so edit that file rather than this one.</small></p>