Running Scripts
Every script is started, set up and stopped from the Script window, or from chat if you prefer typing.
The Script window
Open it with Action → Script. On the left is every script the game can find; the ones you added yourself are marked (custom), and one that cannot load is marked (broken). Selecting a script shows:
- its description — what it does, and anything it needs from you first;
- its settings — a number to type, a box to tick or a choice from a list, depending on the setting;
- Start and Stop, and Reload, which reads the script files again after you have added or changed one.
Settings are remembered for each script, so you only set them once. They are saved when you press Start, when you switch to another script, and when you press Reload.
Pressing Start closes the window so the game can be played normally. Open the window again at any time to see what the script is doing: a status line, and below it the script's log, newest line first. While a script runs, the window offers Stop in place of Start.
Chat commands
Everything the window does can also be typed into chat:
| Command | What it does |
|---|---|
/script list |
Lists every script by file name, with its title and whether it loads. |
/script run sky_pass |
Starts a script by its file name or its title, with its saved
settings. /script sky_pass works too. |
/script run custom/my_loop |
Starts one of your own scripts. The custom/ prefix is
only needed when your script has the same file name as a library
script. |
/script status |
Says which script is running and what it is doing. |
/script stop | Stops the running script. |
What stops a script
A script ends with a line in chat that says why. It stops when:
- it finishes its job, or reaches the goal in its settings;
- you press Esc, click the ground, click a monster, press
Stop or type
/script stop; - you log out or lose the connection;
- a fight against players or their pets starts;
- something it needs is missing — the message says what, for example “Script stopped: the pet list is full -- make room for a Cindyfly”;
- the script has a mistake in it, in which case the message names the file and the line.
The library scripts are written to pick up where they left off. Each step checks what is already done — the item you already hold, the floor you are standing on, the pet already in your list — so after fixing whatever stopped one, start it again and it carries on.
How a script fights
Until a script says otherwise, its fights follow your Battlemation settings: whether you and your pet attack or defend, when to heal each of you, and which medicine to use. Each library script changes that where it needs to; Cindyflys for Thievery, for example, has you defend so the pet gets the kills.
In a pet-party fight, your other pets fight on their own while a script is driving, the same as under Auto Fight.
A script always keeps a pet marching. Some errands hand a pet over — an Ostrigon for the Sky Trial key, a Cindyfly to Nimble Wang — and that leaves nobody marching. Whenever nothing is marching during a script, the pet that marched before is marched again; if that one has gone too, whichever pet you have left is marched, the highest level first. A line in chat says which.
Where the files are
Inside your game folder, scripts live in two places:
| Folder | What is there |
|---|---|
autoscript/library/ |
The scripts that ship with the game. Game updates replace this
folder, so do not edit these files — copy one into
custom/ under a new name and change the copy. |
autoscript/custom/ |
Your own scripts. Updates never touch this folder. It is created the first time you open the Script window. |
Read a script before you run one someone gave you. A script cannot touch the files on your computer or reach the internet, but inside the game it can do anything you can: sell or drop items, stable pets, forget kungfu.