<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>ScriptResource</title><revhistory><revision><revnumber>10</revnumber><date>2014-02-10 18:06:09</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>9</revnumber><date>2013-10-13 01:46:19</date><authorinitials>tech</authorinitials></revision><revision><revnumber>8</revnumber><date>2013-10-13 01:45:28</date><authorinitials>tech</authorinitials></revision><revision><revnumber>7</revnumber><date>2013-02-28 02:50:09</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>6</revnumber><date>2013-02-28 02:29:49</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>5</revnumber><date>2012-10-24 01:25:27</date><authorinitials>Romulus</authorinitials><revremark>Renamed from 'CategoryResource'.</revremark></revision><revision><revnumber>4</revnumber><date>2012-10-24 01:25:18</date><authorinitials>Romulus</authorinitials></revision><revision><revnumber>3</revnumber><date>2012-10-22 01:43:21</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>2</revnumber><date>2012-10-22 01:33:44</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>1</revnumber><date>2012-10-21 15:13:15</date><authorinitials>Inanna</authorinitials></revision></revhistory></articleinfo><para>The script commands in this section pertain to resource management. </para><para><orderedlist><listitem><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/Buy">Buy</ulink></listitem><listitem><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/BuyPrice">BuyPrice</ulink></listitem><listitem><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/CancelTrade">CancelTrade</ulink></listitem><listitem><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/DumpResource">DumpResource</ulink></listitem><listitem><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/MarketUpdate">MarketUpdate</ulink></listitem><listitem><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/Sell">Sell</ulink></listitem><listitem><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/SellPrice">SellPrice</ulink></listitem></orderedlist><!--The macro FullSearchCached caused an error and should be blacklisted. It returned the data '

' which caused the docbook-formatter to choke. Please file a bug.--> </para><section><title><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/Buy">Buy</ulink></title><informaltable><tgroup cols="2"><colspec colname="col_0"/><colspec colname="col_1"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para>Usage: </para></entry><entry colsep="1" rowsep="1"><para>buy resource quantity price </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>Example: </para></entry><entry colsep="1" rowsep="1"><para>buy food 10000 6 </para></entry></row></tbody></tgroup></informaltable><para>Buys resources from the market. In the example above the script will try to buy 10,000 food at a bid price of 6. </para><para>Resource name must be among <emphasis>food, lumber, stone &amp; iron,</emphasis> and must be spelled out. </para><para>It is important to remember that conflicting <ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/Trade#">Trade</ulink> goals with <ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/TradePolicy#">TradePolicy</ulink> may sell the resources as fast as you can buy them via script. </para></section><section><title><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/CancelTrade">CancelTrade</ulink></title><informaltable><tgroup cols="2"><colspec colname="col_0"/><colspec colname="col_1"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para>Usage: </para></entry><entry colsep="1" rowsep="1"><para>canceltrade </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>Example: </para></entry><entry colsep="1" rowsep="1"><para>canceltrade </para></entry></row></tbody></tgroup></informaltable><para>Cancels all pending trades in current city. </para><para>You can also cancel trades by their tradeId: </para><informaltable><tgroup cols="2"><colspec colname="col_0"/><colspec colname="col_1"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para>Usage: </para></entry><entry colsep="1" rowsep="1"><para>canceltrade tradeId </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>Example: </para></entry><entry colsep="1" rowsep="1"><para>execute &quot;canceltrade &quot; + city.tradesArray[0].id </para></entry></row></tbody></tgroup></informaltable><para>This example will cancel the 1st trade in the city's current tradesArray (the oldest trade in the array will be at position 0) </para></section><section><title><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/DumpResource">DumpResource</ulink></title><informaltable><tgroup cols="2"><colspec colname="col_0"/><colspec colname="col_1"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para>Usage: </para></entry><entry colsep="1" rowsep="1"><para>dumpresource xxx,yyy condition resource </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>Example: </para></entry><entry colsep="1" rowsep="1"><para>dumpresource 111,222 f:11000,g:44000 f:3000,g:9000 </para></entry></row></tbody></tgroup></informaltable><para>This is used to transport an amount of resources over a specified threshold to another city. In the example above, when food reaches 11,000 and gold reaches 44,000, it will tranport 3,000 food and 9,000 gold to the city at 111,222 </para></section><section><title><ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/Sell">Sell</ulink></title><informaltable><tgroup cols="2"><colspec colname="col_0"/><colspec colname="col_1"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para>Usage: </para></entry><entry colsep="1" rowsep="1"><para>sell resource quantity price </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>Example: </para></entry><entry colsep="1" rowsep="1"><para>sell food 20000 8 </para></entry></row></tbody></tgroup></informaltable><para>Sells resources on the market. In the example above the script will try to sell 20,000 food at the offer price of 8. </para><para>Resource name must be among <emphasis>food, lumber, stone &amp; iron,</emphasis> and must be spelled out. </para><para>It is important to remember that conflicting <ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/Trade#">Trade</ulink> goals with <ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/TradePolicy#">TradePolicy</ulink> may buy the resources back as fast as you can sell them via script. </para><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="http://guide.neatportal.com/wiki/ScriptResource/wiki/CategoryCommands#">CategoryCommands</ulink> </para></section></article>