<?xml version="1.0" encoding="utf-8"?>
<s1 title="Execute"><table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>execute &quot;actions to be performed&quot; </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>execute &quot;goto city&quot; + city.timeSlot </p>
</td></tr></table><p>Allows you to force the bot to evaluate variables and perform functions or commands using the results. This is useful with older commands that do not support expressions by default.  </p>
<p>In the example above, if you had a script that you wanted to perform differently depending on which city it was being run in, you could set labels for each one... </p>
<p></p>
<source><![CDATA[label city1
do stuff
end

label city2
do other stuff
end

label city3
do this stuff
end

label city4 
do this other stuff
end]]></source><p>You could check which city you&apos;re in with the object city.timeSlot. However if you did <em>goto city.timeSlot</em> you would see the error <em>&quot;Label &apos;city.timeSlot&apos; not found&quot;</em>. This is because the <jump href="/wiki/Goto">Goto</jump> command does not support the evaluation of city.timeSlot on it&apos;s own.  </p>
<p>With execute you could make it evaluate it... </p>
<p></p>
<source><![CDATA[execute "goto city" + city.timeSlot]]></source><p>The above line would evaluate first city.timeSlot into (for example &quot;2&quot;) and then execute the line <em>goto city2</em>, which would jump to the label city2 and perform whatever was there. </p>
<p>There are unlimited more uses for Execute, the above is merely one example.  </p>
<p></p>

<br/>------------------------------------------------------------------------------<br/>
<p> <jump href="/wiki/ScriptControlStructures">ScriptControlStructures</jump> </p>
</s1>