m (→Introduction: typo) |
(working on updates) |
||
Line 126: | Line 126: | ||
==Loop== | ==Loop== | ||
− | {| style="width: | + | {| style="width: 40%; text-align:center" border="1" |
! scope="row" | Usage: | ! scope="row" | Usage: | ||
| loop [optional # of times]<br> | | loop [optional # of times]<br> | ||
Line 195: | Line 195: | ||
{| style="width: 25%; text-align:center" border="1" | {| style="width: 25%; text-align:center" border="1" | ||
! scope="row" | Usage: | ! scope="row" | Usage: | ||
− | | | + | | sleep ''seconds''<br> |
+ | sleep ''hh:mm:ss''<br> | ||
|- | |- | ||
! scope="row" | Example: | ! scope="row" | Example: | ||
− | | | + | | sleep 15<br> |
+ | sleep 1:43<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). | ||
+ | <blockquote> | ||
+ | EXAMPLES:<br> | ||
+ | |||
+ | sleep 30 //Sleeps the script for 30 seconds <br> | ||
+ | sleep 2:45 //Sleeps the script for 2 minutes 45 seconds <br> | ||
+ | sleep 7:25:00 //Sleeps the script for 7 hours, 25 minutes and 0 seconds<br> | ||
+ | </blockquote> | ||
==Sleep @== | ==Sleep @== | ||
Line 206: | Line 217: | ||
{| style="width: 25%; text-align:center" border="1" | {| style="width: 25%; text-align:center" border="1" | ||
! scope="row" | Usage: | ! scope="row" | Usage: | ||
− | | | + | | sleep @:''hh:mm:ss''<br> |
|- | |- | ||
! scope="row" | Example: | ! scope="row" | Example: | ||
− | | | + | | sleep @:14:15:00<br> |
|} | |} | ||
+ | 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. | ||
+ | <blockquote> | ||
+ | sleep @:15:45 //Sleeps the script until 3:45pm local system time<br> | ||
+ | </blockquote> | ||
==Sleep rnd== | ==Sleep rnd== | ||
− | {| style="width: | + | {| style="width: 40%; text-align:center" border="1" |
! scope="row" | Usage: | ! scope="row" | Usage: | ||
− | | | + | | sleep rnd:''maximum.seconds''<br> |
+ | sleep rnd:''minseconds'':''maxseconds''<br> | ||
|- | |- | ||
! scope="row" | Example: | ! scope="row" | Example: | ||
− | | | + | | sleep rnd:15<br> |
+ | sleep rnd:20:30<br> | ||
+ | |} | ||
+ | Sleeps Y.A.E.B. for a random time. | ||
+ | <blockquote> | ||
+ | {| style="width: 75%; text-align:left" border="0" | ||
+ | ! scope="row" | sleep rnd:15 | ||
+ | | //sleep for a random any bnumber of seconds between 0 and 15 | ||
+ | |- | ||
+ | ! scope="row" |sleep rnd:300:600 | ||
+ | | //sleep randomly for at least 5 minutes, but no more than 10 minutes. | ||
|} | |} | ||
+ | </blockquote> | ||
==Logout== | ==Logout== | ||
Line 228: | Line 257: | ||
{| style="width: 25%; text-align:center" border="1" | {| style="width: 25%; text-align:center" border="1" | ||
! scope="row" | Usage: | ! scope="row" | Usage: | ||
− | | | + | | logout @:yourlogofftime @:yourlogontime <br> |
+ | logout ''time'' ''time''<br> | ||
|- | |- | ||
! scope="row" | Example: | ! scope="row" | Example: | ||
− | | | + | | logout @:01:30:31 @:06:35:00 <br> |
+ | logout 1:00 5:00<br> | ||
|} | |} | ||
+ | Disconnects/connects Y.A.E.B. 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. | ||
+ | <blockquote> | ||
+ | 1: logout 1:00 30:00 | ||
+ | 2: attack 400,400 any c:1000,s:1000 | ||
+ | 3: repeat 3 | ||
+ | 4: sleep 45 | ||
+ | 5: loop | ||
+ | </blockquote><br> | ||
+ | <blockquote> | ||
+ | This script will cause the bot to send 3 spam waves to the target every 30 minutes, indefinitely. | ||
+ | </blockquote> | ||
==Ifgoto== | ==Ifgoto== | ||
Line 239: | Line 281: | ||
{| style="width: 25%; text-align:center" border="1" | {| style="width: 25%; text-align:center" border="1" | ||
! scope="row" | Usage: | ! scope="row" | Usage: | ||
− | | | + | | ifgoto ( reference {operator} value ) label<br> |
|- | |- | ||
! scope="row" | Example: | ! scope="row" | Example: | ||
− | | | + | | ifgoto ( m_city.castle.resource.wood.amount > 150000 )<br> |
|} | |} | ||
+ | Conditional Statements enable checking of resources,troops,population,…etc. | ||
+ | * Variables for use in ifgoto statements can be found in the Reference Section. | ||
+ | <blockquote> | ||
+ | See ifgosub | ||
+ | </blockquote> | ||
==Ifgosub== | ==Ifgosub== | ||
Line 250: | Line 297: | ||
{| style="width: 25%; text-align:center" border="1" | {| style="width: 25%; text-align:center" border="1" | ||
! scope="row" | Usage: | ! scope="row" | Usage: | ||
− | | | + | | ifgosub ( reference {operator} value ) label |
|- | |- | ||
! scope="row" | Example: | ! scope="row" | Example: | ||
− | | | + | | ifgosub ( m_city.cityManager.resource.wood.amount > 150000 ) |
|} | |} | ||
+ | Conditional Statements add a whole new dimension to Evobot scripts allowing more human-like interaction & less "insuffient resource" statements. | ||
+ | <blockquote> | ||
+ | ifgosub ( m_city.castle.resource.stone.amount > 250000 ) CheckATT | ||
+ | ifgosub ( m_city.castle.resource.iron.amount > 150000 ) CheckTrain | ||
+ | sleep rnd:3000 | ||
+ | loop 0 | ||
+ | // | ||
+ | label CheckTrain | ||
+ | ifgosub ( m_city.castle.resource.wood.amount > 150000 ) TrainTroops | ||
+ | gosubreturn | ||
+ | // | ||
+ | label CheckATT | ||
+ | ifgosub ( m_city.castle.resource.wood.amount > 250000 ) UpATT | ||
+ | gosubreturn | ||
+ | // | ||
+ | label TrainTroops | ||
+ | train arch:250 Bubba | ||
+ | repeat 4 | ||
+ | gosubreturn | ||
+ | // | ||
+ | label UpATT | ||
+ | walldefense archertowers 250 | ||
+ | gosubreturn | ||
− | + | </blockquote> | |
==ResetGoals== | ==ResetGoals== | ||
Revision as of 14:32, 28 May 2011
Contents
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.
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.
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.
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.
Y.E.A.B. understands the following commands:
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] |
---|---|
Example: | loop loop 5 |
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 |
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).
EXAMPLES:
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 Y.A.E.B. for a random time.
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.
Logout
Usage: | logout @:yourlogofftime @:yourlogontime logout time time |
---|---|
Example: | logout @:01:30:31 @:06:35:00 logout 1:00 5:00 |
Disconnects/connects Y.A.E.B. 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 30: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.
Ifgoto
Usage: | ifgoto ( reference {operator} value ) label |
---|---|
Example: | ifgoto ( m_city.castle.resource.wood.amount > 150000 ) |
Conditional Statements enable checking of resources,troops,population,…etc.
- Variables for use in ifgoto statements can be found in the Reference Section.
See ifgosub
Ifgosub
Usage: | ifgosub ( reference {operator} value ) label |
---|---|
Example: | ifgosub ( m_city.cityManager.resource.wood.amount > 150000 ) |
Conditional Statements add a whole new dimension to Evobot scripts allowing more human-like interaction & less "insuffient resource" statements.
ifgosub ( m_city.castle.resource.stone.amount > 250000 ) CheckATT ifgosub ( m_city.castle.resource.iron.amount > 150000 ) CheckTrain sleep rnd:3000 loop 0 // label CheckTrain ifgosub ( m_city.castle.resource.wood.amount > 150000 ) TrainTroops gosubreturn // label CheckATT ifgosub ( m_city.castle.resource.wood.amount > 250000 ) UpATT gosubreturn // label TrainTroops train arch:250 Bubba repeat 4 gosubreturn // label UpATT walldefense archertowers 250 gosubreturn
ResetGoals
Usage: | |
---|---|
Example: |
Config
Usage: | |
---|---|
Example: |
BuildingGoals
Usage: | |
---|---|
Example: |
TechGoals
Usage: | |
---|---|
Example: |
TroopGoal
Usage: | |
---|---|
Example: |
Autorun
Usage: | |
---|---|
Example: |
SetFocus
Usage: | |
---|---|
Example: |
UpdateAllData
Usage: | |
---|---|
Example: |
// I have NO idea what these do, so I don't even know where to categorize them :D
SetNpcFlag
Usage: | |
---|---|
Example: |
UnsetNpcFlag
Usage: | |
---|---|
Example: |