<?xml version="1.0" encoding="utf-8"?>
<s1 title="ScriptCity"><p>The script commands in this section pertain to your city. </p>
<p>
</p>
<ol><li><jump href="/wiki/Abandon?highlight=%28%5CbScriptCity%5Cb%29">Abandon</jump></li>
<li><jump href="/wiki/AbandonTown?highlight=%28%5CbScriptCity%5Cb%29">AbandonTown</jump></li>
<li><jump href="/wiki/BuildCity?highlight=%28%5CbScriptCity%5Cb%29">BuildCity</jump></li>
<li><jump href="/wiki/BuildingGoals?highlight=%28%5CbScriptCity%5Cb%29">BuildingGoals</jump></li>
<li><jump href="/wiki/CancelBuildcity?highlight=%28%5CbScriptCity%5Cb%29">CancelBuildcity</jump></li>
<li><jump href="/wiki/CancelBuilding?highlight=%28%5CbScriptCity%5Cb%29">CancelBuilding</jump></li>
<li><jump href="/wiki/CancelFortifications?highlight=%28%5CbScriptCity%5Cb%29">CancelFortifications</jump></li>
<li><jump href="/wiki/CancelResearch?highlight=%28%5CbScriptCity%5Cb%29">CancelResearch</jump></li>
<li><jump href="/wiki/CheckResearch?highlight=%28%5CbScriptCity%5Cb%29">CheckResearch</jump></li>
<li><jump href="/wiki/Comfort?highlight=%28%5CbScriptCity%5Cb%29">Comfort</jump></li>
<li><jump href="/wiki/Config?highlight=%28%5CbScriptCity%5Cb%29">Config</jump></li>
<li><jump href="/wiki/Create?highlight=%28%5CbScriptCity%5Cb%29">Create</jump></li>
<li><jump href="/wiki/Demo?highlight=%28%5CbScriptCity%5Cb%29">Demo</jump></li>
<li><jump href="/wiki/DemoSite?highlight=%28%5CbScriptCity%5Cb%29">DemoSite</jump></li>
<li><jump href="/wiki/EvacuateTown?highlight=%28%5CbScriptCity%5Cb%29">EvacuateTown</jump></li>
<li><jump href="/wiki/Goal?highlight=%28%5CbScriptCity%5Cb%29">Goal</jump></li>
<li><jump href="/wiki/Levy?highlight=%28%5CbScriptCity%5Cb%29">Levy</jump></li>
<li><jump href="/wiki/LoadGoals?highlight=%28%5CbScriptCity%5Cb%29">LoadGoals</jump></li>
<li><jump href="/wiki/Production?highlight=%28%5CbScriptCity%5Cb%29">Production</jump></li>
<li><jump href="/wiki/RenameCity?highlight=%28%5CbScriptCity%5Cb%29">RenameCity</jump></li>
<li><jump href="/wiki/ResetGoals?highlight=%28%5CbScriptCity%5Cb%29">ResetGoals</jump></li>
<li><jump href="/wiki/SetFocus?highlight=%28%5CbScriptCity%5Cb%29">SetFocus</jump></li>
<li><jump href="/wiki/SetTaxRate?highlight=%28%5CbScriptCity%5Cb%29">SetTaxRate</jump></li>
<li><jump href="/wiki/Speedups?highlight=%28%5CbScriptCity%5Cb%29">Speedups</jump></li>
<li><jump href="/wiki/StartResearch?highlight=%28%5CbScriptCity%5Cb%29">StartResearch</jump></li>
<li><jump href="/wiki/TechGoals?highlight=%28%5CbScriptCity%5Cb%29">TechGoals</jump></li>
<li><jump href="/wiki/Teleport?highlight=%28%5CbScriptCity%5Cb%29">Teleport</jump></li>
<li><jump href="/wiki/Upgrade?highlight=%28%5CbScriptCity%5Cb%29">Upgrade</jump></li>
<li><jump href="/wiki/WallDefense?highlight=%28%5CbScriptCity%5Cb%29">WallDefense</jump></li>
<li><jump href="/wiki/WarTeleport?highlight=%28%5CbScriptCity%5Cb%29">WarTeleport</jump></li>
</ol>

<p> </p>
<p><s2 title="Abandon">
<p></p>
<s2 id="Abandon Goal" title="Abandon Goal">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>config abandon:[switch] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>config abandon:1 </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Default: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>config abandon:0 </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Switch: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>0 = off<br/>
1 = on </p>
</td></tr></table><p>This goal tells the bot that you are planning to abandon this city. The bot will destroy all troops, wall defenses, and queues in the city and will lower loyalty by levying and adjusting the tax rate upwards. The bot will not perform comforting actions on the city with this goal set. This is useful when you plan to give a city away or abandon it. The bot will not automatically abandon the city once it reaches 0 loyalty. </p>
<p></p>
<p><strong>WARNING</strong> </p>
<p>You should run <jump href="/wiki/EvacuateTown">EvacuateTown</jump> in the scripts window before you set this goal! </p>
<p>Be sure to move out All heroes as well </p>
<p></p>
</s2>
<s2 id="Abandon Script" title="Abandon Script">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>abandon XXX,YYY </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>abandon 111,222 </p>
</td></tr></table><p>This script tells the bot to abandon the valley at 111,222. </p>
 </s2>
<s2 title="AbandonTown">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>abandontown city-coords-or-name </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>abandontown 111,222<br/>
abandontown OtherCity </p>
</td></tr></table><ul><li>The city being abandoned can be referred to by name or coordinates. </li>
<li><p>The bot <strong>does not check</strong> for troops or heroes. Any heroes or troops in the town <strong>or traveling</strong> from the town will be irreplaceably deleted. </p>
</li>
<li>Be sure your escaping troops have arrived at their destination before abandoning any city. </li>
</ul>
<p>Abandontown should be used with care. It is best to allow the bot to build npcs on its own rather than trying to do them manually with this command, but for whatever purpose you must use this command DOUBLE CHECK that you have entered the correct coordinates or city name to be abandoned. Be sure to run <jump href="/wiki/EvacuateTown">EvacuateTown</jump> script command previous to using this command if you have troops or resources in the city to be moved. Be sure to allow all evacuations to complete before running this script command. </p>
<p></p>
<p><strong>WARNING</strong> </p>
<p>There are NO 2nd chances using this command! There is no &quot;Are you sure?&quot; popup if you run this command. If you accidentally delete your level 1200 training hero, we&apos;ll feel really bad for you, but you&apos;re still screwed. </p>
 </s2>
<s2 title="BuildCity">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>buildcity xxx,yyy </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>buildcity 111,222 </p>
</td></tr></table><p>This script is used to build a city at the given coordinates. It will capture the flat for you using your specified <jump href="/wiki/ValleyTroops">ValleyTroops</jump> in goals, or the defaults. Once the city is built, the bot will build a cottage in it to prevent the bot&apos;s npc building functions from abandoning it as a npc. </p>
<p>To cancel a city build already scheduled, use <jump href="/wiki/CancelBuildcity">CancelBuildcity</jump>. </p>
 </s2>
<s2 title="BuildingGoals">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>buildinggoals [build.goal.string] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>buildinggoals st:0:0,b:9:12 </p>
</td></tr></table><p>This command will allow you to add a new <em>build</em> goal directive from the script interface. For more information see the <jump href="/wiki/Build">Build</jump> page. </p>
 </s2>
<s2 title="CancelBuildcity">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>cancelbuildcity<br/>
cancelbuildcity xxx,yyy </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>cancelbuildcity<br/>
cancelbuildcity 123,456 </p>
</td></tr></table><p>Used to cancel a previously scheduled city building command created by the <jump href="/wiki/BuildCity">BuildCity</jump> script. If optional coordinates are given, that particular buildcity queue will be cancelled. If none are given, all cities to be built are cleared from the queue. </p>
 </s2>
<s2 title="CancelBuilding">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>cancelbuilding </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>cancelbuilding </p>
</td></tr></table><p>Used to cancel the building in progress in the city. </p>
 </s2>
<s2 title="CancelFortifications">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>cancelfortifications [remain count] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>cancelfortifications<br/>
cancelfortifications 2 </p>
</td></tr></table><p>Used to cancel fortification queues, leaving remain_count batches. If no remain_count is provided, all batches are removed. </p>
 </s2>
<s2 title="CancelResearch">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>cancelresearch </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>cancelresearch </p>
</td></tr></table><p>Used to cancel the research in progress in the city. </p>
 </s2>
<s2 title="CheckResearch">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>checkresearch </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>checkresearch </p>
</td></tr></table><p>Prints out a list of research techs that can be researched in the city. This list is relative to the city where the command is run, meaning Checkresearch will validate all of the tech and their requirements then make sure that the city meets those requirements. Only the techs that have all of their requirements met will be listed. </p>
 </s2>
<s2 title="Comfort">
<p></p>
<s3 id="Comfort Goal" title="Comfort Goal">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>config comfort:[switch] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>config comfort:1 </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Default: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>config comfort:1 </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Switch: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>0 = off<br/>
1 = on </p>
</td></tr></table><p>Enable the comfort goal and the bot will automagically perform comforting on your city as required. This goal along with config gate:[time], config hiding:[time], config npc:[level] all working together can make your cities virtually impossible to capture. With comforting activated the bot will raise loyalty, reduce grievance, adjust tax rates to prevent riots, and perform miscellaneous comforting actions as specified in comfortpolicy. Comfort can be used by itself or along with comfortpolicy. If you want to use comfortpolicy, this goal is <strong>required</strong>. </p>
<p></p>
</s3>
<s3 id="Comfort Script" title="Comfort Script">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>comfort comforttype </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>comfort pray<br/>
comfort 1<br/>
comfort bless<br/>
comfort 4 </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Comfort Types: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>1 - relief<br/>
2 - pray<br/>
3 - bless<br/>
4 - popraise </p>
</td></tr></table><p>Performs one of the comfort commands in the city that it is run from. </p>
 </s2>
<s2 title="Config">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>config [directive]:[value] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>config wartown:0 </p>
</td></tr></table><p>In order to allow control of all the bot functions through the scripting interface, all <em>config</em> switches that can be set in the goals page are accessible in your script. The new settings will be retained until: </p>
<ul><li>they are changed again through a script command </li>
<li>the Set Goals button in the Goals page is selected, or </li>
<li>the bot is restarted. </li>
</ul>
<p>The changes made to settings through the script interface will only change the values currently in memory. No actual changes are made to the Goals page and all values can be restored to settings on the goals page by selecting <strong>Set Goals</strong> with the goals window displayed. </p>
 </s2>
<s2 title="Create">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>create buildingtype [position id] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>create cottage<br/>
create fo<br/>
create barrack<br/>
create a 0<br/>
create embassy 2 </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Building Types: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>academy - a<br/>
barrack - b<br/>
beacon tower - be<br/>
cottage - c<br/>
embassy - e<br/>
feasting hall - fh<br/>
forge - fo<br/>
farm - f<br/>
sawmill - s<br/>
quarry - q<br/>
iron mine - i<br/>
inn - inn<br/>
market - m<br/>
rally spot - r<br/>
relief station - rs<br/>
stable - st<br/>
town hall - t<br/>
wall - w<br/>
warehouse - wh<br/>
workshop - ws </p>
</td></tr></table><p>Create is used to build a building on an empty space, if there are no spaces to build, the create command will attempt to create a building until there is one and eventually time out. The Create command will automatically speed up the construction process for those buildings that are less than 5 minutes build time. In other words, for those buildings, like a cottage, that can be instantly built, Create will do this. The create command will perform several checks before it creates a building, it will first check to see if another construction is underway and automatically sleep until that construction is done, it also checks for resources, and if none are present, will sleep until they are. </p>
<p>A specific position ID can be given with create for building, as shown in the 4th and 5th examples above. Use the following numbers for each tile: </p>
<p>[Image:http://i.imgur.com/IRtmGbf.png]</img> [Image:http://i.imgur.com/r1Voz7t.png]</img> </p>
 </s2>
<s2 title="Demo">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>demo buildingtype [policy] [@positionId]</p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>demo cottage<br/>
demo forge level10<br/>
demo s highestlevel<br/>
demo /dynamite ws<br/>
demo any @15 </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Building Types: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>academy - a<br/>
barrack - b<br/>
beacon tower - be<br/>
cottage - c<br/>
embassy - e<br/>
feasting hall - fh<br/>
forge - fo<br/>
farm - f<br/>
sawmill - s<br/>
quarry - q<br/>
iron mine - i<br/>
inn - inn<br/>
market - m<br/>
rally spot - r<br/>
relief station - rs<br/>
stable - st<br/>
town hall - t<br/>
wall - w<br/>
warehouse - wh<br/>
workshop - ws </p>
</td></tr></table><p>The demo command will demolish a building by one level at a time. It is important to note that you must specifically order the demolition of a level 10 building, either by using the <em>level10</em> argument or <em>highestlevel 10</em>. As with the <jump href="/wiki/Upgrade">Upgrade</jump> command, Demo will not do anything to a level 10 building otherwise.  </p>
<p>You may specify the location of a building to demo with @. For example <em>demo b @20</em> would demolish one level of the barrack at position 20 in the city, while <em>demo any @20</em> would demolish one level of any building at position 20. See below for position ids. </p>
<p>You may also use dynamite with the Demo command. Just add the /dynamite flag to your demo command. For example <em>demo /dynamite fo</em> would use dynamite to completely demolish the forge, while <em>demo /dynamite any @13</em> would use dynamite to completely demolish any building at position 13.  See below for position ids. </p>
<ul><li><source><![CDATA[demo c level10
repeat 5
demo c
repeat 45]]></source></li>
</ul>
<p>The above example will demo 5 cottages to level 9, then proceed by demo&apos;ing these cottages completely to 0. Another way of doing this is using the highest/lowestlevel building arguments, and making sure that your repeat command only repeats enough times to accommodate 5 level 10 cottages. </p>
<p></p>
<s3 id="Building Policies" title="Building Policies">
<p>Building Policies are for defining arguments of level, in such, these are the building policies that can be used for the label levelX listed in the syntax usage of each construction command. (Currently, there are no options for the create command, it defaults to the first available “lot” to create a building): levelX whereas you input a desired level between 1 and 10 (IE level1; level5) with no space Used with upgrade command Used with demo command </p>
<p>lowestlevel whereas you input the desired “up to that” level in place of X (optional). This policy selects buildings that are the lowest levels to perform the argued command (IE upgrade cottage !lowestlevel) (must have space) Used with upgrade command Used with demo command </p>
<p>highestlevel whereas you input the desired “up to that” level in place of X (optional). This policy selects buildings that are the highest levels to perform the argued command (IE demo cottage !highestlevel) (must have space) </p>
<p>Used with upgrade command Used with demo command </p>
<p>X Optional augment for policy arguments, it allows to specify a level to be equal to or greater than/less than the desired level to be upgraded or demolished. level level10 will demo to level 9, it will upgrade to level 10 using a mich script </p>
<p>Level specification now has abbreviations, you can now use hi for highestlevel, lo for lowest level and le for level. </p>
<p>Using highestlevel or level10 arguments will utilize a mich script when used with the upgrade command. The only way to demolish a level 10 building is to use highestlevel or level10 </p>
<p>Position IDs are as follows: </p>
<p>[Image:http://i.imgur.com/IRtmGbf.png]</img> [Image:http://i.imgur.com/r1Voz7t.png]</img> </p>
 </s2>
<s2 title="DemoSite">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>demosite [position ID] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>demosite 36<br/>
demosite /dynamite 36 </p>
</td></tr></table><p>The demosite command allows you to demolish/downgrade 1 level of the building located at a specific position in your city. The level or type of building doesn&apos;t matter with demosite, so be careful you don&apos;t put in the site id# for a level 10 building you wanted to keep. You may use the /dynamite switch to have the bot use dynamite to completely demolish the building at a specific position rather than just one level of it, as shown in the example above. </p>
<p>Position IDs are as follows: </p>
<p>[Image:http://i.imgur.com/IRtmGbf.png]</img> [Image:http://i.imgur.com/r1Voz7t.png]</img> </p>
<p>For renovating a newly capped npc, the position IDs are as follows: </p>
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Position: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Building </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>0 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Academy </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>1 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Forge </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>2 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Embassy </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>3 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Feasting Hall </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>4 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Market Place </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>5 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Beacon Tower </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>6 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Stable </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>7 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Inn </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>8 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Rally Spot </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>9 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Relief Station </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>10 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Workshop </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>11 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Barracks </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>12-31 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Cottage </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>1001-1037 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Farm </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>1038 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Sawmill </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>1039 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Quarry </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>1040 </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>Iron Mine </p>
</td></tr></table> </s2>
<s2 title="EvacuateTown">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>evacuatetown coords </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>evacuatetown 111,222 </p>
</td></tr></table><p>This script command will tell the bot to send all troops and resources that it can carry to the specified coordinates from this city, in order for the town to be abandoned later. The bot will leave all of the heroes in the city. You must move them manually. This script should be run before <jump href="/wiki/Abandon">config abandon:1</jump> is used in goals. </p>
<p>To cancel the evacuation use EndEvacuate. </p>
 </s2>
<s2 title="Goal">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>goal [desired goal [parameters]] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>goal config npc:5<br/>
goal research ar:4,ms:5 </p>
</td></tr></table><p>This command will allow you to execute the script line as a goal. It is optional, in the above example just &quot;config npc:5&quot; as a script line would work to adjust the goal config npc to &apos;5&apos;. Any goal can be executed via a script line without this optional command, but this may be useful when a goal and a script have the same name, and you want it to modify the goal explicitly. </p>
 </s2>
<s2 title="Levy">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>levy levytype </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>levy 1<br/>
levy food </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Levy Types: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>1 - gold<br/>
2 - food<br/>
3 - wood<br/>
4 - stone<br/>
5 - iron </p>
</td></tr></table><p>Performs one of the levy actions in the city. </p>
 </s2>
<s2 title="LoadGoals">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>loadgoals [goal set number] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>loadgoals<br/>
loadgoals 3 </p>
</td></tr></table><p>This script command will allow you to load a set of goals to be ran by the bot. </p>
<p>An example of a use for this would be in a city used for trebbing. You could tell the bot to load goal set 1, where you have your npc farming and hero movement and such disabled, perform all the treb hits via scripts, and then reload your regular goal set 0 where you have npc farming and such enabled when the treb hits are done. A script doing this could be like so: </p>
<ul><li><source><![CDATA[//Trebbing Session
gosub TrebSession

label BeginHere
ifgoto ( m_city.cityManager.resource.stone.amount < 5b ) OuttaStone
ifgoto ( m_city.cityManager.fortification.rockfall < 10500 ) Rebuildwall
goto BeginHere

label Rebuildwall
setmayorbyname Queen
walldefense tre 11k build
sleep 15
goto BeginHere

label OuttaStone
echo "Getting Low On Stone!"
loadgoals 0
stop

label TrebSession
loadgoals 1
walldefense tra 50000 demo
walldefense ab 50000 demo
walldefense at 50000 demo
walldefense r 50000 demo
walldefense tre 50000 demo
gosub BeginHere]]></source></li>
</ul>
 </s2>
<s2 title="Production">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>production food% wood% stone% iron% </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>production 100 100 100 100 </p>
</td></tr></table><p>Production functions as both a goal and script of the same name. It sets the desired city production of resources. </p>
<p>You must use a number between 0 and 100. Troop production may adjust production rates down temporarily if permitted to via the goal config <jump href="/wiki/TroopsUsePopMax">TroopsUsePopMax</jump>. </p>
<p>If used as a script, it will also set the corresponding goal to the same values, until the next bot restart. </p>
 </s2>
<s2 title="RenameCity">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>renamecity newname [picture ID 1-4] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>renamecity BottingRulz<br/>
 renamecity BottingRulz 3 </p>
</td></tr></table><p>Change a city&apos;s name and (optionally) picture. The picture IDs are as follows: </p>
<ul><li><p>1 - [Image:http://imageshack.us/a/img411/2904/citylogo01.png]</img> </p>
</li>
<li><p>2 - [Image:http://imageshack.us/a/img802/2310/citylogo02.png]</img> </p>
</li>
<li><p>3 - [Image:http://imageshack.us/a/img209/3374/citylogo03.png]</img> </p>
</li>
<li><p>4 - [Image:http://imageshack.us/a/img16/9365/citylogo04.png]</img> </p>
</li>
</ul>
 </s2>
<s2 title="ResetGoals">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>resetgoals </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>resetgoals </p>
</td></tr></table><p>This command will temporarily reset/disable your goals until the next bot restart. It will: remove all building, tech, &amp; fortification directives; cancel all troop requirements, erase all config statements, erase all variables; set <jump href="/wiki/ReportsToKeep">ReportsToKeep</jump> &amp; <jump href="/wiki/DistancePolicy">DistancePolicy</jump> to default values; delete <jump href="/wiki/NpcBounds">NpcBounds</jump>, <jump href="/wiki/NpcHeroes">NpcHeroes</jump>, <jump href="/wiki/NoLevelHeroes">NoLevelHeroes</jump>, <jump href="/wiki/SpamHeroes">SpamHeroes</jump>; remove all <jump href="/wiki/SendResources">SendResources</jump>, <jump href="/wiki/KeepResources">KeepResources</jump>, <jump href="/wiki/SendTroops">SendTroops</jump>, <jump href="/wiki/KeepTroops">KeepTroops</jump> directives, set <jump href="/wiki/HomeHeroes">HomeHeroes</jump> to 1, <jump href="/wiki/TrainingHero">TrainingHero</jump> &quot;&quot; 300 -1 -1, <jump href="/wiki/GatePolicy">GatePolicy</jump> 0 0 0 0 0; and reset: <jump href="/wiki/DefensePolicy">DefensePolicy</jump>, <jump href="/wiki/WarehousePolicy">WarehousePolicy</jump>, <jump href="/wiki/FarmingPolicy">FarmingPolicy</jump>, <jump href="/wiki/RallyPolicy">RallyPolicy</jump>, <jump href="/wiki/TradePolicy">TradePolicy</jump>, <jump href="/wiki/ProcessingPolicy">ProcessingPolicy</jump>, and <jump href="/wiki/Hunting">Hunting</jump>. </p>
 </s2>
<s2 title="SetFocus">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>setfocus </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>setfocus<br/>
setfocus 5 </p>
</td></tr></table><p>The bot functions in a linear manner, moving from one city to the next after a given amount of time. This command will cause the bot to immediately focus on the city from which the command is issued for one task cycle. </p>
<p>Enabling the Task Flow debug option will allow you to see what one task cycle is, and how long it lasts. </p>
<p>You can optionally give it a number of task cycles to focus on the city for. Be careful running this too much or for too long, as the bot&apos;s normal flow of tasks is already designed to be optimal. </p>
 </s2>
<s2 title="SetTaxRate">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>settaxrate % </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>settaxrate 20 </p>
</td></tr></table><p>Sets the city&apos;s tax rate to the number specified. </p>
<p>Note - this will not change the taxpolicy for the city. If you want the tax rate to be set and stay there, make sure the taxpolicy does not conflict, or just use <jump href="/wiki/TaxPolicy">TaxPolicy</jump> as a script command instead, i.e. - <em>taxpolicy 20 100</em> to change it immediately to 20 and stay there. </p>
 </s2>
<s2 title="StartResearch">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>startresearch techname or research speed/cost [/nowait] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>startresearch compass<br/>
startresearch quickest<br/>
startresearch construction<br/>
startresearch dearest </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Arguments: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>quickest<br/>
cheapest<br/>
dearest<br/>
ag - agriculture<br/>
lu - lumbering<br/>
mas - masonry<br/>
mi - mining<br/>
met - metal<br/>
in - info<br/>
ms - militaryscience<br/>
mt - militarytradition<br/>
ir - ironwork<br/>
lo - logistics<br/>
com - compass<br/>
ho - horseback<br/>
ar - archery<br/>
st - stockpile<br/>
med - medicine<br/>
con - construct<br/>
en - engineer<br/>
mac - machinery<br/>
pr - privateer </p>
</td></tr></table><p>This command will perform a research of the valid tech argument in the city that it is run from. As an option, you can run a <jump href="/wiki/CheckResearch">CheckResearch</jump> command first to see what is available to you, allowing you to tailor the script to techs you are currently not researching. </p>
<p>an optional &quot;/nowait&quot; arugment can be supplied that prevents the script waiting until the research is finalized. </p>
 </s2>
<s2 title="TechGoals">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>techgoals [research.goal.string] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>techgoals ar:10,ho:10,mt:9 </p>
</td></tr></table><p>This command will allow you to add a new <em>research</em> goal directive from the script interface. For more information see the <jump href="/wiki/Research">Research</jump> page. </p>
<p>This command is deprecated, you can now just use <em>research</em> in scripts to modify the research goals. </p>
 </s2>
<s2 title="Teleport">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>teleport [state name or random]<br/>
 teleport [coords]   (uses Advanced City Teleport to move to specified coords)<br/>
 warteleport [coords]  (uses War Teleporter to move to specific barbarian city coords) </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>teleport saxony<br/>
 teleport 111,222<br/>
 warteleport 123,45 </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>States: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>friesland, saxony, north march, bohemia,<br/>
lower lorraine, franconia, thuringia, moravia,<br/>
upper lorraine, swabia, bavaria, carinthia,<br/>
burgundy, lombardy, tuscany, romagna <br/>
 or <br/>
 random </p>
</td></tr></table><p>Randomly teleports your city to the state specified, or a random state if using <em>teleport random</em>. </p>
<p>If instead you use coordinates, the bot will advance teleport your city to the coordinates specified. When trying to advance teleport, the bot will first use the Pioneer teleports available after server merge if you have them. </p>
 </s2>
<s2 title="Upgrade">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>upgrade buildingtype levelX </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>upgrade cottage<br/>
upgrade barrack level8<br/>
upgrade farm lowestlevel </p>
</td></tr></table><p>Upgrades an existing building. </p>
<p>In order to create a level 10 building, which requires the use of a Michaelangelo Script, you must first have a building currently at level 9, a Script in your items, and you must specify level9 in the upgrade command. </p>
<p>The script: </p>
<ul><li><source><![CDATA[upgrade iron
repeat]]></source></li>
</ul>
<p>Would only build all your iron mines to level 9 and stop. To create a level 10 building, you must specify: </p>
<ul><li><source><![CDATA[upgrade iron level9]]></source></li>
</ul>
<p></p>
<s3 id="Building Policies" title="Building Policies">
<p>Building Policies are for defining arguments of level, in such, these are the building policies that can be used for the label levelX listed in the syntax usage of each construction command. (Currently, there are no options for the create command, it defaults to the first available “lot” to create a building): levelX whereas you input a desired level between 1 and 10 (IE level1; level5) with no space Used with upgrade command Used with demo command </p>
<p>lowestlevel whereas you input the desired “up to that” level in place of X (optional). This policy selects buildings that are the lowest levels to perform the argued command (IE upgrade cottage !lowestlevel) (must have space) Used with upgrade command Used with demo command </p>
<p>highestlevel whereas you input the desired “up to that” level in place of X (optional). This policy selects buildings that are the highest levels to perform the argued command (IE demo cottage !highestlevel) (must have space) </p>
<p>Used with upgrade command Used with demo command </p>
<p>X Optional augment for policy arguments, it allows to specify a level to be equal to or greater than/less than the desired level to be upgraded or demolished. level level10 will demo to level 9, it will upgrade to level 10 using a mich script </p>
<p>Level specification now has abbreviations, you can now use hi for highestlevel, lo for lowest level and le for level. </p>
<p>Using highestlevel or level10 arguments will utilize a mich script when used with the upgrade command. The only way to demolish a level 10 building is to use highestlevel or level9 </p>
 </s2>
<s2 title="WallDefense">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>walldefense DefType Qty [BuildType] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>walldefense at 1000<br/>
walldefense ab 1000 demo </p>
</td></tr></table><p>Used to build or demolish wall defenses. </p>
<p><em>Starting in NeatBot version 3378</em> you can use multiple wall fortifications on a single line for demolish commands. You can also put the &apos;demo&apos; action before or after the fortification types. These 4 different scripts will all demolish 5000 archer towers, 1000 abatis, and 1000 traps: </p>
<p></p>
<source><![CDATA[ walldefense at:5k,ab:1k,tra:1k demo]]></source><p></p>
<source><![CDATA[ walldefense demo at:5k,ab:1k,tra:1k]]></source><p></p>
<source><![CDATA[ walldefense /demo at:5k,ab:1k,tra:1k]]></source><p></p>
<source><![CDATA[ walldefense at 5k demo
 walldefense ab 1k demo
 walldefense tra 1k demo]]></source><p>You can also use the /keep action to force the bot to demolish all but the kept amount. Only specifically listed fortification types will be affected. For example, this will demolish all but 15,000 archer towers, 1000 abatis, and 1000 traps. Any rolling logs and trebs will not be effected: </p>
<p></p>
<source><![CDATA[ walldefense /keep at:15k,ab:1k,tra:1k]]></source><p>Here are several examples of ways to use the walldefense command in <em>NeatBot versions 3378 and later</em>: </p>
<p></p>
<source><![CDATA[ walldefense                 // build 1 trap (compatibility with older versions)

 walldefense at 100
 walldefense at:100          //same as above
 walldefense build at:100    //same as above
 walldefense /build at:100   //same as above
 walldefense at 100 produce  //same as above (compatibility)

 walldefense demo            // demolish 1 trap
 walldefense destruct tra 10 // demolish 10 traps (compatibility)

 walldefense at demo        // demolish 1 archer tower
 walldefense at             // build 1 archer tower (compatibility)
 walldefense at keep        // keep 1 archer tower (demolish all archer towers except one)

 // demolish 100 traps and 10,000 archers towers
 walldefense demo tra:100,at:10k
 walldefense /demo tra:100,at:10k // same as above

 // demolish all but 100 traps and 1,000 archers towers (other fortifications are unaffected)
 walldefense keep tra:100,at:1k
 walldefense /keep tra:100,at:1k // same as above

 // demolish all trebuchets (other fortifications are unaffected)
 walldefense /keep tre:0]]></source> </s2>
<s2 title="WarTeleport">
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Usage: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>warteleport [coords] </p>
</td></tr><tr><td><strong class="highlight"><![CDATA[]]></strong><p>Example: </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p>warteleport 123,456 </p>
</td></tr></table><p>Teleports your city to the coordinates specified using a war teleporter. You can only use the coordinates of an existing npc. </p>
 </p>
<p></p>

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