Table of Contents
VilloNanny Strategy ManualAvailable Strategies
About StrategiesVilloNanny is built around the concept of “Strategy”: a strategy is a “plugin” that performs some actions. For example, a strategy can grow your crop, another strategy can attack a given village every hour, another strategy can send you an email when attacked. As you see, the meaning of “strategy” goes beyond the military term. An important concept is that strategies are generally independent from one another and can be enabled only when needed. To enable a strategy, you modify the “configuration.xml” file and add a <strategy> tag inside a <village> tag. Any village can contain any number of strategies of any type… as long as it makes sense to you: it wouldn't be clever to insert a strategy to build the Palace and another one to destroy it! Since VilloNanny v2.3.0 it is possible to run a strategy after another strategy has completed, or while another strategy has not completed yet (see below). SyntaxA strategy tag has the following general form: <strategy class="NAME" desc="DESCRIPTION" enabled="true" runWhile="RUNWHILE_UID" waitFor="WAITFOR_UID" uid="UID"> <SOMEPARAMETERS/> </strategy> There is also a shorter form for strategies without parameters: <strategy class="NAME" desc="DESCRIPTION" enabled="true" runWhile="RUNWHILE_UID" waitFor="WAITFOR_UID" uid="UID"/> Notice how the tag is closed with a slash at the end. Attributes and parameters
uidYou must ensure that all uid's are unique, so there must not be more than one uid=“xxx” with the same value for “xxx”. The value of a uid can be any alphanumeric string of any length, like: uid="s23433" uid="1" uid="a" uid="dog1" uid="Farm Caesar 01" When the program starts, it checks that all uid's are present and that they don't repeat. If some uid is missing, it will be added to the configuration file. A backup file will be created in such a case. The format of the configuration file will remain quite similar to the original, but not the same. enabledYou can disable a strategy, without removing it from the configuration, by setting enabled="false" even while the program is running. waitFor and runWhileYou can specify that a strategy can only start after another strategy is done for good. For example, start a UpgradeTroop only after the GrowItem for the barracks has reached the maxLevel. This is done with the “waitFor” attribute: you specify the uid of the strategy that must be executed before this one starts. You can also specify that a strategy must be active only if another one is still active. For example, you can run the ResourceSender while the GrowItem is running and make it automatically stop when the GrowItem has reached the maxLevel. This is done with the “runWhile” attribute: you specify the uid of the strategy that must be running for this one to be executed. Not all strategies can be waited for: you can't wait for a Farmizzator to terminate, for example. It wouldn't make sense because a Farmizzator never stops farming. The same for “runWhile”: it doesn't make sense to run while a Farmizzator runs because it never stops. ExamplesThe following example shows two villages with different strategies: <village desc="my village 01" enabled="true" uid="v342525"> <url>http://speed.travian.com/dorf1.php?33455</url> <strategy class="FieldGrowth" desc="Grow Cheapest Field" enabled="true" uid="s552345"/> </village> <village desc="my village 02" enabled="true" uid="v329425"> <url>http://speed.travian.com/dorf1.php?463435</url> <strategy class="RatedFieldGrowth" desc="Grow Half Crop" enabled="true" uid="s934823"> <productionRate wood="10" clay="10" iron="10" crop="5"/> </strategy> </village> The following example shows one village with two strategies: <village desc="my village 01" enabled="true" uid="v342525"> <url>http://speed.travian.com/dorf1.php?33455</url> <strategy class="FieldGrowth" desc="Grow Cheapest Field" enabled="true" uid="s123435"/> <strategy class="RatedFieldGrowth" desc="Grow Half Crop" enabled="true" uid="s423512"> <productionRate wood="10" clay="10" iron="10" crop="5"/> </strategy> </village> waitForThe following example shows one village with two strategies using the waitFor attribute: <village desc="my village 01" enabled="true" uid="v342525"> <url>http://speed.travian.com/dorf1.php?33455</url> <strategy class="FieldGrowth" desc="Grow Cheapest Field" enabled="true" uid="s123435"/> <strategy class="RatedFieldGrowth" desc="Grow Half Crop" enabled="true" uid="s423512"> <productionRate wood="10" clay="10" iron="10" crop="5"/> </strategy> <!-- look at the waitFor attribute --> <strategy class="GrowItem" desc="Grow the Cranny" enabled="true" uid="s825590"> <item id="38" desc="Cranny" maxLevel="10"/> </strategy> <strategy class="GrowItem" desc="Grow the Market after the Cranny" enabled="true" uid="s825589" waitFor="s825590"> <item id="36" desc="Market" maxLevel="10"/> </strategy> </village> The strategy “s825589” will build the Market only after the cranny reaches maxLevel 10.
|
![]() |