From NEAT Portal Wiki
Jump to: navigation, search
(Label)
(Autorun)
 
(30 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Introduction==
 
==Introduction==
  
Y.E.A.B. script allows you to enter commands to the bot that will be performed immediately, as opposed to goals which are what the bot works towards. For instance, the `directive '''troop a:5000''' in the goals window tells Y.E.A.B. to build archers until you have 5000 then move to the next goal. If you already have 5000 or more archers, it is disregarded. The script command '''train a:5000''' will immediately queue 5000 archers in your barracks regardless of how many you have already, provided of course you have the population and resources needed.
+
Scripting allows you to enter commands to the bot that will be performed immediately line by line, as opposed to goals which are gradually worked towards. For instance, the directive ''troop a:5000'' in the goals window tells the bot to build archers until you have 5000 then move to the next goal. If you already have 5000 or more archers, it is disregarded. The script command ''train a:5000'' will immediately queue 5000 archers in your barracks regardless of how many you have already, provided of course you have the population and resources needed.
 
   
 
   
 
The Script window is similar to the Goals window, and is found by selecting the ''Script'' tab on the upper left hand window.  There are 5 individual script windows per city, allowing you to build up to 5 command sets per city, that will be saved (provided you select the ''save'' button) along with your goals. Individual scripts are selected by way of the ''Load'' button.
 
The Script window is similar to the Goals window, and is found by selecting the ''Script'' tab on the upper left hand window.  There are 5 individual script windows per city, allowing you to build up to 5 command sets per city, that will be saved (provided you select the ''save'' button) along with your goals. Individual scripts are selected by way of the ''Load'' button.
  
The commands available give you the ability to perform all of the the same functions Y.E.A.B. works towards in the goals window, as well as add to or alter those goals. Note that goals modified or added in the script window will not be reflected in the goals window, or saved with them.   
+
The commands available give you the ability to perform all of the the same functions the bot works towards in the goals window, as well as add to or alter those goals. Note that goals modified or added in the script window will not be reflected in the goals window, or saved with them.   
  
With the latest releases of Y.A.E.B. the script set has been expanded to include '''ifgosub''' and '''ifgoto''' statements allowing you to automatically make decisions based on conditions in your city, such as the amount of lumber or number of warriors you have on hand.   
+
The script set includes ''ifgosub'' and ''ifgoto'' statements allowing you to automatically make decisions based on conditions in your city, such as the amount of lumber or number of warriors you have on hand.   
  
Scripts are executed from the top down, beginning at the line number specified in the '''Run''' box.  If no number is entered, or the number is greater than the number of lines in the script, the script begins at line #1.  
+
Variables for use in ''ifgoto & ifgosub'' statements can be found in the [[Reference Section]].
  
Y.E.A.B. understands the following commands:
+
Scripts are executed from the top down, beginning at the line number specified in the ''Run'' box. If no number is entered, or the number is greater than the number of lines in the script, the script begins at line #1.
  
 
==Label==
 
==Label==
Line 46: Line 46:
 
Allows you to jump to any label, anywhere in the script.  
 
Allows you to jump to any label, anywhere in the script.  
  
<blockquote>
+
<blockquote><pre>
label medalfarm<br>
+
label medalfarm
attack 123,300 !Bubba,!Xavier,any t:400,b:400<br>
+
attack 123,300 !Bubba,!Xavier,any t:400,b:400
goto trainarch<br>
+
goto trainarch
label upgradecot<br>
+
label upgradecot
upgrade house<br>
+
upgrade house
repeat 2<br>
+
repeat 2
label trainarch<br>
+
label trainarch
train arch:2500 atk<br>
+
train arch:2500 atk
 
goto upgradecot
 
goto upgradecot
</blockquote>
+
</pre></blockquote>
 
 
  
 
==Gosub==
 
==Gosub==
Line 71: Line 70:
 
Allows you to jump to a subroutine.
 
Allows you to jump to a subroutine.
  
<blockquote>
+
<blockquote><pre>
gosub medalfarm<br>
+
gosub medalfarm
gosub trainarch<br>
+
gosub trainarch
gosub upgradecot<br>
+
gosub upgradecot
loop 0<br>
+
loop 0
label medalfarm<br>
+
label medalfarm
attack 123,300 !Bubba,!Xavier,any t:400,b:400<br>
+
attack 123,300 !Bubba,!Xavier,any t:400,b:400
gosubreturn<br>
 
//<br>
 
label upgradecot<br>
 
upgrade house<br>
 
repeat 2<br>
 
gosubreturn<br>
 
//<br>
 
label trainarch<br>
 
train arch:2500 Hero<br>
 
 
gosubreturn
 
gosubreturn
</blockquote>
+
//
 
+
label upgradecot
 +
upgrade house
 +
repeat 2
 +
gosubreturn
 +
//
 +
label trainarch
 +
train arch:2500 Hero
 +
gosubreturn
 +
</pre></blockquote>
  
 
==GosubReturn==
 
==GosubReturn==
Line 103: Line 101:
 
Used at the end of a subroutine to return to the line that called it, and proceed from there.
 
Used at the end of a subroutine to return to the line that called it, and proceed from there.
  
<blockquote>
+
<blockquote><pre>
gosub medalfarm<br>
+
gosub medalfarm
gosub trainarch<br>
+
gosub trainarch
gosub upgradecot<br>
+
gosub upgradecot
loop 0<br>
+
loop 0
label medalfarm<br>
+
label medalfarm
attack 123,300 !Bubba,!Xavier,any t:400,b:400<br>
+
attack 123,300 !Bubba,!Xavier,any t:400,b:400
gosubreturn<br>
+
gosubreturn
//<br>
+
//
label upgradecot<br>
+
label upgradecot
upgrade house<br>
+
upgrade house
repeat 2<br>
+
repeat 2
gosubreturn<br>
 
//<br>
 
label trainarch<br>
 
train arch:2500 Hero<br>
 
 
gosubreturn
 
gosubreturn
</blockquote>
+
//
 
+
label trainarch
 +
train arch:2500 Hero
 +
gosubreturn
 +
</pre></blockquote>
  
 
==Loop==
 
==Loop==
Line 142: Line 139:
 
Allows you to repeat your entire script, or using a label repeat parts of a script. No parameter, or a  parameter of 0 (ie - loop 0), will repeat the script indefinitely.  
 
Allows you to repeat your entire script, or using a label repeat parts of a script. No parameter, or a  parameter of 0 (ie - loop 0), will repeat the script indefinitely.  
  
<blockquote>
+
<blockquote><pre>
//===============================<br>
+
//===============================
// Upgrade everything in your<br>
+
// Upgrade everything in your
// city, as long as tech and<br>
+
// city, as long as tech and
// resource requirements are met<br>
+
// resource requirements are met
//===============================<br>
+
//===============================
       upgrade<br>
+
       upgrade
       loop<br>
+
       loop
<br>
+
 
//===============================<br>
+
//===============================
// Upgrade your farms, sawmills<br>
+
// Upgrade your farms, sawmills
// and your ironmines, then<br>
+
// and your ironmines, then
// repeat the process again<br>
+
// repeat the process again
// 5 times<br>
+
// 5 times
//===============================<br>
+
//===============================
       upgrade farm<br>
+
       upgrade farm
       upgrade saw<br>
+
       upgrade saw
       upgrade iron<br>
+
       upgrade iron
       loop 5<br>
+
       loop 5
<br>
+
 
//===============================<br>
+
//===============================
// Upgrade your farms, sawmills<br>
+
// Upgrade your farms, sawmills
// and your ironmines, then<br>
+
// and your ironmines, then
// upgrade cottages and repeat the cottages again<br>
+
// upgrade cottages and repeat the cottages again
// 5 times<br>
+
// 5 times
//===============================<br>
+
//===============================
       upgrade farm<br>
+
       upgrade farm
       upgrade saw<br>
+
       upgrade saw
       upgrade iron<br>
+
       upgrade iron
       label cotupgrade<br>
+
       label cotupgrade
       upgrade cottage<br>
+
       upgrade cottage
 
       loop 5 cotupgrade
 
       loop 5 cotupgrade
</blockquote>
+
</pre></blockquote>
  
 
==Repeat==
 
==Repeat==
Line 189: Line 186:
 
The repeat command will simply repeat the previous line of script the specified number of times. No parameter, or a  parameter of 0 (ie - repeat 0), will repeat the previous line indefinitely.
 
The repeat command will simply repeat the previous line of script the specified number of times. No parameter, or a  parameter of 0 (ie - repeat 0), will repeat the previous line indefinitely.
  
<blockquote><br>//================================<br>// Attack 2 targets, then upgrade<br>// your cottages first, followed<br>// by your barracks<br>//================================ </blockquote><blockquote>attack 245,325 Bubba arch:25000,warr:25000,t:1000<br>attack 222,324 any t:400,b:400<br>upgrade cottage<br>repeat 12<br>upgrade barrack<br>repeat 12</blockquote><blockquote>//================================<br>//   Upgrade all of your buildings<br>//   and resource fields to level 9:<br>//================================ </blockquote><blockquote>upgrade<br>repeat</blockquote>
+
<blockquote><pre>
 +
//================================
 +
// Attack 2 targets, then upgrade
 +
// your cottages first, followed
 +
// by your barracks
 +
//================================  
 +
attack 245,325 Bubba arch:25000,warr:25000,t:1000
 +
attack 222,324 any t:400,b:400
 +
upgrade cottage
 +
repeat 12
 +
upgrade barrack
 +
repeat 12
 +
 
 +
//================================
 +
// Upgrade all of your buildings
 +
// and resource fields to level 9:
 +
//================================  
 +
upgrade
 +
repeat
 +
</pre></blockquote>
  
 
==Sleep==
 
==Sleep==
Line 205: Line 221:
 
sleep 4:22:32<br>
 
sleep 4:22:32<br>
 
|}
 
|}
The sleep command will cause Y.A.E.B. to pause for the indicated time, which can be expressed as seconds only (i.e. 34, 240, 23432), minutes and seconds (i.e. 4:30) or hours, minutes, seconds (2:44:34).
+
The sleep command will cause the bot to pause for the indicated time, which can be expressed as seconds only (i.e. 34, 240, 23432), minutes and seconds (i.e. 4:30) or hours, minutes, seconds (2:44:34).
  
<blockquote>
+
<blockquote><pre>
EXAMPLES:<br>
+
sleep 30 //Sleeps the script for 30 seconds
 
+
sleep 2:45 //Sleeps the script for 2 minutes 45 seconds
{|
+
sleep 7:25:00 //Sleeps the script for 7 hours, 25 minutes and 0 seconds
|sleep 30|| ||//Sleeps the script for 30 seconds  
+
</pre></blockquote>
|-
 
|sleep 2:45|| ||//Sleeps the script for 2 minutes 45 seconds
 
|-
 
|sleep 7:25:00|| ||//Sleeps the script for 7 hours, 25 minutes and 0 seconds<br>
 
|}
 
</blockquote>
 
  
 
==Sleep @==
 
==Sleep @==
Line 232: Line 242:
 
Note that there is always a slight variation between the Evony engine clock and your system time.  The exact time difference between the Evony engine and your computer system time is displayed at startup or any time you click the '''Refresh''' button on the top left of the screen.
 
Note that there is always a slight variation between the Evony engine clock and your system time.  The exact time difference between the Evony engine and your computer system time is displayed at startup or any time you click the '''Refresh''' button on the top left of the screen.
  
<blockquote>
+
<blockquote><pre>
sleep @:15:45     <br>
+
sleep @:15:45 //Sleeps the script until 3:45pm local system time
 
+
</pre></blockquote>
//Sleeps the script until 3:45pm local system time</blockquote>
 
  
 
==Sleep rnd==
 
==Sleep rnd==
Line 251: Line 260:
 
|}
 
|}
  
Sleeps Y.A.E.B. for a random time.
+
Sleeps the bot for a random time.
<blockquote>
 
{|
 
| sleep rnd:15 || || //sleep for a random any bnumber of seconds between 0 and 15
 
|-
 
| sleep rnd:300:600 || || //sleep randomly for at least 5 minutes, but no more than 10 minutes.
 
|}
 
  
</blockquote>
+
<blockquote><pre>
 +
sleep rnd:15 //sleep for a random number of seconds between 0 and 15
 +
sleep rnd:300:600 //sleep randomly for at least 5 minutes, but no more than 10 minutes.
 +
</pre></blockquote>
  
 
==Logout==
 
==Logout==
Line 267: Line 273:
 
|  
 
|  
 
logout @:logouttime @:logontime<br>
 
logout @:logouttime @:logontime<br>
logout ''time.to.out'' ''tim.to.on''
+
logout ''time.to.out'' ''time.to.on''
 
|-
 
|-
 
! style="text-align:left;" | Example:
 
! style="text-align:left;" | Example:
Line 275: Line 281:
 
|}
 
|}
  
Disconnects/connects Y.A.E.B. from/to the server. Time must be expressed in 24 hr format if using tha @ option.   
+
Disconnects/connects the bot from/to the server. Time must be expressed in 24 hr format if using tha @ option.   
  
 
Note that any script running that causes the bot to diconnect '''''will continue running''''' again once the bot reconnects.  
 
Note that any script running that causes the bot to diconnect '''''will continue running''''' again once the bot reconnects.  
  
<blockquote>
+
<blockquote><pre>
1: logout 1:00 30:00<br>
+
1: logout 1:00 29:00
2: attack 400,400 any c:1000,s:1000 <br>
+
2: attack 400,400 any c:1000,s:1000  
3: repeat 3<br>
+
3: repeat 3
4: sleep 45<br>
+
4: sleep 45
5: loop<br>
+
5: loop
</blockquote>
+
</pre></blockquote>
 
This script will cause the bot to send 3 spam waves to the target every 30 minutes, indefinitely, disconnecting from the server in between each set.
 
This script will cause the bot to send 3 spam waves to the target every 30 minutes, indefinitely, disconnecting from the server in between each set.
  
==Ifgoto==
+
==Goal==
  
 
{| class="wikitable"
 
{| class="wikitable"
 
! style="text-align:left;" | Usage:
 
! style="text-align:left;" | Usage:
| ifgoto ( reference {operator} value ) label
+
| goal [desired goal [parameters]]
 
|-
 
|-
 
! style="text-align:left;" | Example:
 
! style="text-align:left;" | Example:
| ifgoto ( m_city.cityManager.resource.wood.amount > 150000 )
+
|
 +
goal config npc:5<br>
 +
goal research ar:4,ms:5
 
|}
 
|}
  
See [[Intro_to_Scripts#Ifgosub|ifgosub]]
+
This command will allow you to execute the script line as a goal. It is optional, in the above example just "config npc:5" as a script line would work to adjust the goal config npc to '5'. 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.
 
 
==Ifgosub==
 
 
 
{| class="wikitable"
 
! style="text-align:left;" | Usage:
 
| ifgosub ( reference {operator} value ) label
 
|-
 
! style="text-align:left;"| Example:
 
| ifgosub ( m_city.cityManager.resource.wood.amount > 150000 )
 
|}
 
 
 
Conditional Statements enable checking of resources,troops,population,…etc.
 
 
 
Conditional Statements add a whole new dimension to Y.A.E.B. scripts allowing more human-like interaction & less "insuffient resource" statements.
 
 
 
Variables for use in ifgoto & ifgosub statements can be found in the [[Reference Section]].
 
 
 
<blockquote>
 
'''Sample script:'''<br>
 
 
 
ifgosub ( m_city.cityManager.resource.stone.amount > 250000 ) CheckATT<br>
 
ifgosub ( m_city.cityManager.resource.iron.amount > 150000 ) CheckTrain<br>
 
sleep rnd:3000<br>
 
loop 0<br>
 
//<br>
 
label CheckTrain<br>
 
ifgosub ( m_city.cityManager.resource.wood.amount > 150000 ) TrainTroops<br>
 
gosubreturn <br>
 
//<br>
 
label CheckATT<br>
 
ifgosub ( m_city.cityManager.resource.wood.amount > 250000 ) UpATT<br>
 
gosubreturn<br>
 
//<br>
 
label TrainTroops<br>
 
train arch:250 Bubba<br>
 
repeat 4<br>
 
gosubreturn<br>
 
//<br>
 
label UpATT<br>
 
walldefense archertowers 250<br>
 
gosubreturn <br>
 
 
 
</blockquote>
 
  
 
==ResetGoals==
 
==ResetGoals==
Line 353: Line 318:
 
|}
 
|}
  
'''Note:''' The scope of this command is in question. Experimentation has shown that while most ''confi''g directives are set to 0 or false, it is unclear if all config directives are affected or what other settings/directives may be affected.
+
This command will:
 
+
remove all building, tech, & fortification directives;
'''''Use of this command is NOT recommended.'''''
+
cancel all troop requirements, erase all config statements, erase all variables;
 
+
set reportstokeep & distancepolicy to default values;
In order to maintain control over the actions performed by Y.A.E.B., best practice when altering settings through the script interface is to only change specific values required by your script. These values can then be changed back to the original setting through another script call, or upon completion of the script by selecting the SetGoals button from the Goals window.
+
delete npcbounds, npcheroes, nolevelheroes, spamheroes;
 +
remove all send/keep resource/troops directives,
 +
set homeheroes:1, traininghero "" 300 -1 -1, gatepolicy 0 0 0 0 0
 +
reset: defencepolicy, HeroPolicy, WarehousePolicy, FarmingPolicy, RallyPolicy, tradepolicy, ProcessingPolicy, & hunting
  
 
==Config==
 
==Config==
Line 368: Line 336:
 
| config wartown:0
 
| config wartown:0
 
|}
 
|}
In order to allow control of all Y.A.E.B. functions through the scripting interface, all ''config'' switches that can be set in the goals page are accessible in your script.  The new settings will be retained until:
+
In order to allow control of all the bot functions through the scripting interface, all ''config'' switches that can be set in the goals page are accessible in your script.  The new settings will be retained until:
 
*they are changed again through a script command
 
*they are changed again through a script command
 
*the Set Goals button in the Goals page is selected, or  
 
*the Set Goals button in the Goals page is selected, or  
Line 411: Line 379:
  
 
This command will allow you to add a new ''troop'' goal directive from the script interface.  For more information see the [[Troop Goals]] section.
 
This command will allow you to add a new ''troop'' goal directive from the script interface.  For more information see the [[Troop Goals]] section.
 
==Autorun==
 
 
This command has been incorporated into the startup screen.
 
 
==SetFocus==
 
 
{| class="wikitable"
 
! style="text-align:left;" | Usage:
 
| setfocus
 
|-
 
! style="text-align:left;" | Example:
 
| setfocus
 
|}
 
 
Y.A.E.B. functions in a linear manner, moving from one city to the next after a given amount of time.  The ''setfocus'' command will  cause the bot to immediately focus on the city from which the command is issued.
 
 
==UpdateAllData==
 
 
{| class="wikitable"
 
! style="text-align:left;" | Usage:
 
|
 
|-
 
! style="text-align:left;" | Example:
 
|
 
|}
 
 
This command has not yet been defined.
 

Latest revision as of 06:21, 16 August 2012

Introduction

Scripting allows you to enter commands to the bot that will be performed immediately line by line, as opposed to goals which are gradually worked towards. For instance, the directive troop a:5000 in the goals window tells the bot to build archers until you have 5000 then move to the next goal. If you already have 5000 or more archers, it is disregarded. The script command train a:5000 will immediately queue 5000 archers in your barracks regardless of how many you have already, provided of course you have the population and resources needed.

The Script window is similar to the Goals window, and is found by selecting the Script tab on the upper left hand window. There are 5 individual script windows per city, allowing you to build up to 5 command sets per city, that will be saved (provided you select the save button) along with your goals. Individual scripts are selected by way of the Load button.

The commands available give you the ability to perform all of the the same functions the bot works towards in the goals window, as well as add to or alter those goals. Note that goals modified or added in the script window will not be reflected in the goals window, or saved with them.

The script set includes ifgosub and ifgoto statements allowing you to automatically make decisions based on conditions in your city, such as the amount of lumber or number of warriors you have on hand.

Variables for use in ifgoto & ifgosub statements can be found in the Reference Section.

Scripts are executed from the top down, beginning at the line number specified in the Run box. If no number is entered, or the number is greater than the number of lines in the script, the script begins at line #1.

Label

Usage: label name
Example: label comfort; label upgraderax

Creates a placeholder within the scripts that can be referenced for a loop or goto command.

attack 360,843 any t:400,b:400
attack 344,567 any t:400,b:400
attack 400,543 any t:400,b:400
label upgrade
upgrade barrack
loop upgrade 5

Goto

Usage: goto label
Example: goto upgradecot

Allows you to jump to any label, anywhere in the script.

label medalfarm
attack 123,300 !Bubba,!Xavier,any t:400,b:400
goto trainarch
label upgradecot
upgrade house
repeat 2
label trainarch
train arch:2500 atk
goto upgradecot

Gosub

Usage: gosub label
Example: gosub medalfarm

Allows you to jump to a subroutine.

gosub medalfarm
gosub trainarch
gosub upgradecot
loop 0
label medalfarm
attack 123,300 !Bubba,!Xavier,any t:400,b:400
gosubreturn
//
label upgradecot
upgrade house
repeat 2
gosubreturn
//
label trainarch
train arch:2500 Hero
gosubreturn

GosubReturn

Usage: gosubreturn
Example: gosubreturn

Used at the end of a subroutine to return to the line that called it, and proceed from there.

gosub medalfarm
gosub trainarch
gosub upgradecot
loop 0
label medalfarm
attack 123,300 !Bubba,!Xavier,any t:400,b:400
gosubreturn
//
label upgradecot
upgrade house
repeat 2
gosubreturn
//
label trainarch
train arch:2500 Hero
gosubreturn

Loop

Usage:

loop [optional # of times]
loop [optional label]
loop [optional # of times] [optional label]

Example:

loop
loop 5
loop upgrade
loop 2 upgrade

Allows you to repeat your entire script, or using a label repeat parts of a script. No parameter, or a parameter of 0 (ie - loop 0), will repeat the script indefinitely.

//===============================
// Upgrade everything in your
// city, as long as tech and
// resource requirements are met
//===============================
      upgrade
      loop

//===============================
// Upgrade your farms, sawmills
// and your ironmines, then
// repeat the process again
// 5 times
//===============================
      upgrade farm
      upgrade saw
      upgrade iron
      loop 5

//===============================
// Upgrade your farms, sawmills
// and your ironmines, then
// upgrade cottages and repeat the cottages again
// 5 times
//===============================
      upgrade farm
      upgrade saw
      upgrade iron
      label cotupgrade
      upgrade cottage
      loop 5 cotupgrade

Repeat

Usage: repeat [optional # of times]
Example:

repeat
repeat 5

The repeat command will simply repeat the previous line of script the specified number of times. No parameter, or a parameter of 0 (ie - repeat 0), will repeat the previous line indefinitely.

//================================
// Attack 2 targets, then upgrade
// your cottages first, followed
// by your barracks
//================================ 
attack 245,325 Bubba arch:25000,warr:25000,t:1000
attack 222,324 any t:400,b:400
upgrade cottage
repeat 12
upgrade barrack
repeat 12

//================================
// Upgrade all of your buildings
// and resource fields to level 9:
//================================ 
upgrade
repeat

Sleep

Usage:

sleep seconds
sleep hh:mm:ss

Example:

sleep 15
sleep 1:43
sleep 4:22:32

The sleep command will cause the bot to pause for the indicated time, which can be expressed as seconds only (i.e. 34, 240, 23432), minutes and seconds (i.e. 4:30) or hours, minutes, seconds (2:44:34).

sleep 30		//Sleeps the script for 30 seconds
sleep 2:45		//Sleeps the script for 2 minutes 45 seconds
sleep 7:25:00		//Sleeps the script for 7 hours, 25 minutes and 0 seconds

Sleep @

Usage: sleep @:hh:mm:ss
Example: sleep @:14:15:00

The sleep @ command will puase Y.A.E.B. until the time indicated, based on the system time of your computer. The time must be expressed in 24 hr. format, with 00:00:01 being 1 second after midnight, and 12:00:01 being 1 second past noon. This feature is similar to camp time with the added advantage that the bot will calculate how much camp time is required for your troops to arrive at the given time.

Note that there is always a slight variation between the Evony engine clock and your system time. The exact time difference between the Evony engine and your computer system time is displayed at startup or any time you click the Refresh button on the top left of the screen.

sleep @:15:45		//Sleeps the script until 3:45pm local system time

Sleep rnd

Usage:

sleep rnd:maximum.seconds
sleep rnd:minseconds:maxseconds

Example:

sleep rnd:15
sleep rnd:20:30

Sleeps the bot for a random time.

sleep rnd:15		//sleep for a random number of seconds between 0 and 15
sleep rnd:300:600	//sleep randomly for at least 5 minutes, but no more than 10 minutes.

Logout

Usage:

logout @:logouttime @:logontime
logout time.to.out time.to.on

Example:

logout @:01:30:31 @:06:35:00
logout 1:00 5:00

Disconnects/connects the bot from/to the server. Time must be expressed in 24 hr format if using tha @ option.

Note that any script running that causes the bot to diconnect will continue running again once the bot reconnects.

1: logout 1:00 29:00
2: attack 400,400 any c:1000,s:1000 
3: repeat 3
4: sleep 45
5: loop

This script will cause the bot to send 3 spam waves to the target every 30 minutes, indefinitely, disconnecting from the server in between each set.

Goal

Usage: goal [desired goal [parameters]]
Example:

goal config npc:5
goal research ar:4,ms:5

This command will allow you to execute the script line as a goal. It is optional, in the above example just "config npc:5" as a script line would work to adjust the goal config npc to '5'. 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.

ResetGoals

Usage: resetgoals
Example: resetgoals

This command will: remove all building, tech, & fortification directives; cancel all troop requirements, erase all config statements, erase all variables; set reportstokeep & distancepolicy to default values; delete npcbounds, npcheroes, nolevelheroes, spamheroes; remove all send/keep resource/troops directives, set homeheroes:1, traininghero "" 300 -1 -1, gatepolicy 0 0 0 0 0 reset: defencepolicy, HeroPolicy, WarehousePolicy, FarmingPolicy, RallyPolicy, tradepolicy, ProcessingPolicy, & hunting

Config

Usage: config [directive]:[value]
Example: config wartown:0

In order to allow control of all the bot functions through the scripting interface, all config switches that can be set in the goals page are accessible in your script. The new settings will be retained until:

  • they are changed again through a script command
  • the Set Goals button in the Goals page is selected, or
  • the bot is restarted.

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 Set Goals with the goals window displayed.

For more information please refer to the Intro to Goals Section of this Wiki.

BuildingGoals

Usage: buildinggoals [build.goal.string]
Example: buildinggoals st:0:0,b:9:12

This command will allow you to add a new build goal directive from the script interface. For more information see the Building Goals section.

TechGoals

Usage: techgoals [research.goal.string]
Example: techgoals ar:10,ho:10,mt:9

This command will allow you to add a new research goal directive from the script interface. For more information see the Research Goals section.

TroopGoal

Usage: troopgoal [troop.goal.string]
Example: troopgoal w:5k,a:10k

This command will allow you to add a new troop goal directive from the script interface. For more information see the Troop Goals section.