<?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>CityResource</title><revhistory><revision><revnumber>24</revnumber><date>2014-03-07 17:24:21</date><authorinitials>tech</authorinitials></revision><revision><revnumber>23</revnumber><date>2014-02-10 18:42:31</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>22</revnumber><date>2013-12-20 20:30:35</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>21</revnumber><date>2013-04-27 20:55:16</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>20</revnumber><date>2013-04-27 20:54:54</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>19</revnumber><date>2013-04-27 20:54:17</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>18</revnumber><date>2013-04-27 20:53:40</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>17</revnumber><date>2013-04-27 20:52:13</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>16</revnumber><date>2013-04-27 20:51:38</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>15</revnumber><date>2013-04-27 20:19:07</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>14</revnumber><date>2012-11-27 14:52:37</date><authorinitials>Romulus</authorinitials></revision><revision><revnumber>13</revnumber><date>2012-11-21 04:57:30</date><authorinitials>Inanna</authorinitials><revremark>Renamed from 'Object CityResource'.</revremark></revision><revision><revnumber>12</revnumber><date>2012-10-26 03:48:54</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>11</revnumber><date>2012-10-26 03:46:57</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>10</revnumber><date>2012-10-24 00:42:27</date><authorinitials>Romulus</authorinitials></revision><revision><revnumber>9</revnumber><date>2012-10-24 00:41:53</date><authorinitials>Romulus</authorinitials></revision><revision><revnumber>8</revnumber><date>2012-10-23 21:20:41</date><authorinitials>Romulus</authorinitials><revremark>Renamed from 'Resource'.</revremark></revision><revision><revnumber>7</revnumber><date>2012-10-23 20:20:17</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>6</revnumber><date>2012-10-23 20:19:25</date><authorinitials>Inanna</authorinitials><revremark>Renamed from 'ResourceVars'.</revremark></revision><revision><revnumber>5</revnumber><date>2012-10-23 14:42:53</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>4</revnumber><date>2012-10-23 13:49:37</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>3</revnumber><date>2012-10-23 13:43:14</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>2</revnumber><date>2012-10-23 13:33:05</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>1</revnumber><date>2012-10-23 13:04:13</date><authorinitials>Inanna</authorinitials></revision></revhistory></articleinfo><para>The City Resource objects can reference details about the various resources of city the script is run in. </para><para><emphasis role="strong">City resource objects can be referenced as:</emphasis> </para><itemizedlist><listitem override="none"><para><emphasis>m_city.cityManager.resource.property <emphasis role="strong">or</emphasis> city.resource.property</emphasis> </para></listitem></itemizedlist><para>The .property at the end is how you will specify which detail you are referencing. Using the table below, you can for example get the loyalty of the city with <emphasis>city.resource.support</emphasis>. </para><para><emphasis role="strong">Properties</emphasis> </para><informaltable><tgroup cols="3"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para><emphasis role="strong">Property </emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Type</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Description </emphasis> </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>maxPopulation </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the maximum population possible in the city based on cottage levels. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>curPopulation </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the current population in the city. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>workPeople </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the total number of the city's population assigned to the labor force. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>support </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the city's loyalty. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>complaint </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the city's grievance. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>troopCostFood </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the city's upkeep based on troops. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>texRate </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the tax rate. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>taxIncome </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount of gold gained per hour based on the tax rate. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>gold </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount of gold in the city. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>food </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount of food in the city. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>wood </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount of wood in the city. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>stone </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount of stone in the city. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>iron </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount of iron in the city. </para></entry></row></tbody></tgroup></informaltable><para> The following city resource objects are available for each type of in-game resource. For example, you can reference the amount of workers assigned to iron production with <emphasis>city.resource.iron.workPeople</emphasis>. </para><para> Each of the following should be used in the format city.resource.xxx.property, for example: <emphasis>city.resource.food.amount</emphasis>. </para><para> Available in-game resource types here would be food, wood, stone, and iron. </para><informaltable><tgroup cols="3"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para><emphasis role="strong">Property </emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Type</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Description </emphasis> </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>xxx.workPeople </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount of the city's population assigned to the labor force for this particular resource, ie - <emphasis>city.resource.food.workPeople</emphasis> returns population assigned to farm production. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>xxx.increaseRate </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount per hour of the city's gain in this particular resource, ie - <emphasis>city.resource.food.increaseRate</emphasis> returns food income per hour, before upkeep is deducted. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>xxx.storeRercent </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount of this particular resource that is stored in the warehouse, ie - <emphasis>city.resource.food.storeRercent</emphasis> returns the % of food saved by the warehouse if one exists. These all default to 25% unless changed via warehousepolicy. Yes there is a typo in the name, it's Rercent not Percent. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>xxx.amount </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount of this particular resource in the city, ie - <emphasis>city.resource.iron.amount</emphasis> returns how much iron the city has. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>xxx.max </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the maximum production capacity for this particular resource in the city, ie - <emphasis>city.resource.iron.max</emphasis> returns how much iron the city can have before production will stop. </para></entry></row></tbody></tgroup></informaltable><para> The following city resource objects are also available for each type of in-game resource, but do not use the same format to reference them. </para><para> The following should be used as <emphasis>m_city.cityManager.property.xxx <emphasis role="strong">or</emphasis> city.property.xxx</emphasis>, for example to reference the amount of reserved food in the city, you would use <emphasis>city.reservedResource.food</emphasis>. </para><para> Available in-game resource types here would be gold, food, wood, stone, and iron. </para><informaltable><tgroup cols="3"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para><emphasis role="strong">Property </emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Type</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Description </emphasis> </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>estResource.xxx </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the estimated amount of this particular resource, ie - <emphasis>city.estResource.wood</emphasis> would return the estimated wood amount in the city. Estimated resources are what the bot thinks it should have based on income and use, and may vary slightly from the actual amount the server thinks it has. The bot updates the actual amount with the server the same as the Evony client does, on a delay. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>ResourceProduction.xxx </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the percentage amount of labor force assigned to this particular resource, ie - <emphasis>city.ResourceProduction.wood</emphasis> would return 100 when you have 100% possible assigned to it. Since gold is not produced by labor force, it is not valid as a resource here. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>reservedResource.xxx </para></entry><entry colsep="1" rowsep="1"><para>int </para></entry><entry colsep="1" rowsep="1"><para>Returns the amount of this particular resource that is reserved for upkeep, etc. For example <emphasis>city.reservedResource.gold</emphasis> would return the amount of gold needed in that city for hero salary for 24 hours. </para></entry></row></tbody></tgroup></informaltable><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="http://guide.neatportal.com/wiki/CityResource/wiki/ScriptObjects#">ScriptObjects</ulink> </para></article>