(→setnpcflag) |
m (Protected "Intro to Scripts" ([edit=sysop] (indefinite) [move=sysop] (indefinite))) |
(No difference)
|
Revision as of 03:17, 25 May 2011
Contents
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: | |
---|---|
Example: |
Sleep
Usage: | |
---|---|
Example: |
Sleep @
Usage: | |
---|---|
Example: |
Sleep rnd
Usage: | |
---|---|
Example: |
Logout
Usage: | |
---|---|
Example: |
Ifgoto
Usage: | |
---|---|
Example: |
Ifgosub
Usage: | |
---|---|
Example: |
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: |