Scripts
In order to use a script, you must specify the script file name in the account config file.
"script": "MyScriptName"
The script will execute once the account is fully connected and ready to move around.
You have two variable you can use inside every scripts.
Account
: It holds the account informations, visit the data example to have an overview of accessible data.Plugin
: It's an object with every plugin instances.
MyScriptName.js
In this example, we use the default Map
plugin to try and move our character.
Keep in mind that the method used in this example could change.
function* start() {
console.log(`${Account.username} begins the route.`);
yield Plugin.Map.goTo(0, -16);
yield Plugin.Chat.privateMessage("Genesis", "Using %s.", ["Potion de Rappel"]);
yield Plugin.Inventory.use("Potion de Rappel");
}
That's it. Yes it's not that much for scripts because there isn't a lot to talk about, you are just using plugins essentially.