Draw what a bot does on the world map, without code: where it goes, in which order, what it does at each stop, and what happens when something fails.
The Studio is the part of the package editor where you draw what a bot does instead of writing it. You draw a plan on the world map: the stops the bot goes to, the order it goes round them in, and at each stop the steps it runs there, such as waiting or playing another plan. Conditions, such as how full the bags are, decide whether a stop or a step runs, and when the plan ends. The plan is saved as a file of the package, and @asterobot:base plays it when a bot plays the package.
What you need
| You need | Why |
|---|---|
| A local package | The Studio opens in the package editor, which only edits local packages. To start from someone else's plan, copy it into one of yours: see Plans of other packages. |
@asterobot:base in your library |
Base plays plans, gives the conditions about the character, such as its level or how full its bags are, and the steps to gather resources, fight monsters, rest, eat and change equipment. A package that has plans depends on it, and the Studio adds that dependency for you. See Install base. |
| An extracted game version | The world map is drawn from game data. See Extract game data. |
| A bot connected to a game | Only to play the plan. Drawing needs no bot. |
The world map shows the game version Asterobot is tested against when its game data is extracted. A badge in the map's toolbar gives its number, and resting the pointer on it says that it's the version bots meet. When that version isn't extracted, the Studio uses the most recent extracted one and the badge reads Incompatible version: map ids and game texts can differ from what a bot meets. When no version is extracted at all, No extracted game version stands where the map would be, and says to extract one in the Game Manager: the map then shows up on its own, as soon as the version is ready. The panel still works meanwhile, but there's nothing to draw on.
Note
Coming soon. Base will give more steps that act in the game, such as going to the bank or selling. For now its steps gather resources, fight monsters, rest, eat and change equipment, so a plan built on base alone travels, gathers, fights, recovers, waits, checks the character's state and plays other plans. Other steps that act in the game come from other packages, or from your own: Steps and conditions shows how a package gives its functions to the Studio.
Start a plan
A new package that starts with the Studio
- In Library Manager, click New package.
- Type a Name, and keep or change the Version.
- Turn on Start with the Studio.
- Click Create and edit.
The editor opens on plans/main.js, an empty plan, in the Studio. The package also gets an index.js that does nothing but play that plan and pass on its settings, and it depends on @asterobot:base, at the newest version installed.
When base isn't installed, @asterobot:base isn't installed appears under the switch and Create and edit stays greyed out until you install it there. See Install base.
A plan in a package you already have
- Open the package in the editor with Edit code, from Library Manager or from the package's page.
- At the top of Files, click plan, next to file. The New plan dialog opens.
- Type a Name, such as
farm: letters, digits,-and_, starting with a letter or a digit. The file it becomes,plans/farm.js, shows under the field. - Click New plan, or press Enter.
The dialog says Letters, digits, - and _ only. for a name it refuses, and This package already has a file at that path. when the plan would replace a file.
The new plan opens in the Studio with no stop and a One way circuit. Like a file added with file, it's only in the package once you save. If the package doesn't depend on base yet, the Studio adds it to the package's dependencies right away, at the newest version installed, and a notification says so. If base isn't installed at all, the @asterobot:base isn't installed dialog opens.
Important
A plan only plays when something plays it. In a package started with the Studio, index.js plays plans/main.js. Any other plan plays when a plan that's playing reaches it, through a Play a plan step or an interrupt, or when your own code plays it, as The editor shows. Adding a plan to a package that has its own code changes nothing about what that code does.
Any file whose first line marks it as a plan opens in the Studio, whatever folder it's in. Plans have their own icon in Files.
Install base
Base can be installed from three places: the New local package dialog, the dialog that opens after you create a plan, and Add base to the dependencies in the panel's alert The package doesn't depend on @asterobot:base. They all work the same way:
- Paste the ID or the link of base's file on asterobot.net in File ID or URL. Browse packages on asterobot.net opens the site's library if you need to find it.
- Click Preview, and check what it will install, as in Install from the marketplace.
- Click Install. When that version is already in your library, the button is Use it instead.
In the editor, base is then added to the package's dependencies. The alert in the panel shows whenever the package doesn't depend on base: its Add base to the dependencies button adds the dependency, or opens the install dialog when base isn't installed.
The screen
The Studio takes the place of the code. The world map is on the left and the panel on the right. Drag the line between them to share the room: Asteroboard remembers the position in this browser.
The world map is the one from a Game page's Maps tab, with its search, its switches, its zoom and its list of world maps (see World map). Here a click on a square doesn't open the map: it does what the tool in hand does.
The panel starts with the plan's name, Name this plan, which the bot's console uses too. Next to it are Undo, Redo and View as code. Under them come four tabs: Circuit, Interrupts, Settings and Problems.
While a plan is open, the editor's top bar keeps Save and Run, but not Game: the Studio has its own world map. The error count there includes the plans' problems.
Draw the stops
A stop is a place and the steps the bot runs there. Stops are numbered in the order of the circuit, on the map and in the panel. The tools are in the world map's toolbar:
| Tool | What it does |
|---|---|
| Select | Selects the stop under the pointer. Click the same square again to go through the stops on it, maps and zones first. A click where there's no stop clears the selection. |
| Map | Adds a stop on the map of the square you click. |
| Zone | Paints the squares you drag over into a zone: the selected stop when it's a zone, otherwise a new one. Shift+drag erases squares from the selected zone. |
| Subarea | Adds a stop on the subarea under the pointer. |
A stop's number on the world map can be clicked with any tool, and selects that stop. While Zone is in hand, dragging paints instead of moving the map: pick Select to move it.
Map. When several maps share a square, such as an outdoor map and the interiors that open off it, a list titled with the square's coordinates opens: Maps at 4,-19. Each line gives a map's ID and its subarea, and in the travel graph marks the map a trip can go to, outdoors as a rule. Click one to add it, or close the list with its cross or Escape. A click where there's no map says No map stands on this square.
Zone. Each square you paint takes the map a trip goes to on that square, the one in the travel graph. One drag is one change, undone in one go. The bot visits a zone's maps nearest first.
Subarea. The stop covers every map of the subarea. There's no tool for an area: select a stop and change its Place to An area, as described in Edit a stop.
Query. The Query button, next to Stops on the Circuit tab, adds a stop whose maps are found while the plan plays, from what you name. Each field is a switch: turn on the ones you want, fill them in, and click Add the stop. Every field you turn on narrows the maps. Add the stop stays greyed out until a field other than Has a zaap is set: a zaap alone, or nothing at all, would take every map of the game, and the stop would show The query must name a subarea, an area, a monster, a resource, coordinates or a world map: otherwise it picks every map of the game.
| Field | Keeps the maps |
|---|---|
| Subarea | In that subarea, searched by name. |
| Area | In that area, searched by name. |
| Monster | In a subarea where that monster lives, searched by name. |
| Resource | Where that item is harvested, such as wheat, searched by name. |
| Has a zaap | With an active zaap. |
| X, Y | At those coordinates. |
| World map id | On that world map. 1 is the world of the Twelve. |
What the world map shows
- Each stop's place: a map's square, a zone's squares filled in, a subarea's or an area's outline, with the stop's number on it.
- An arrow from each stop to the next. When the circuit repeats, a dashed arrow goes from the last stop back to the first.
- The selected stop, in a colour of its own.
- Only the stops on the world map on screen. An arrow to or from a stop on another world map, such as Incarnam, is a short stub labelled like to 4 · Incarnam. Click the label to show that world map.
A query stop isn't drawn, since its maps are only known while the plan plays, and neither is a map that's on no world map, such as an instance or a house. The arrows go straight from the stop before them to the stop after.
The list of stops
Stops, on the Circuit tab, lists the stops in order. Each line has the stop's number, its name or what its place is, its number of steps, on no world map for a map that can't be drawn, and a red count when something is wrong with it.
- Click a line to select the stop and centre the world map on it.
- Drag a line to move the stop, or use the arrows that appear when the pointer rests on it. The arrows on the map follow.
With no stop yet, the list says "No stop yet: pick the Map, Zone or Subarea tool and click on the world map."
The circuit
The top of the Circuit tab says the order the bot visits the stops in, and how many times. Four presets set both at once:
| Preset | Order | Repeat | What the bot does |
|---|---|---|---|
| Loop | As drawn | Forever | The stops in their order, again and again. |
| One way | As drawn | Once | The stops in their order, once. A new plan starts like this. |
| Sweep | Nearest first | Forever | The nearest stop that still has work, again and again. |
| Until | As drawn | Until a condition | The stops in their order, until a condition holds. |
You can also set Order and Repeat yourself, for example a sweep until a condition holds. No preset is highlighted then, and the line under them says "Another combination of order and repeat."
With Until a condition, the condition is under Until. It starts as "After 60 min of play": change it as described in Conditions. It's checked after each stop, and at the end of a lap once the lap is counted, so "After lap 3" ends the plan right as the third lap ends.
One time round the circuit is a lap. Here is how a lap goes:
- As drawn takes the stops in the order of the list. Nearest first visits every stop once per lap too, but each time it picks the stop whose map is nearest.
- A stop whose Only if condition is false when it comes up is skipped for this lap.
- At a stop, the bot goes to its maps one after the other: first the one it stands on, then the nearest of the others each time. It gets there by a trip, map after map.
- A map no trip reaches is skipped, with a line in the bot's console. When no trip reaches any of a stop's maps, the stop fails.
- On each map, the bot runs the stop's steps in order. A stop with no step is a waypoint: the bot only passes through.
- Once ends the plan after one lap. Forever and Until a condition start the next one. A lap always lasts at least a second.
A step from a package can tell the plan there's nothing more to do on a map for now, for example when everything there has been gathered, and when to come back. The bot then leaves that map alone until that time, or until the next lap, in both orders. When every map left is waiting, the bot waits for the first one to have work again instead of going round for nothing.
Edit a stop
Select a stop, in the list or with Select, and it opens under the list:
| Part | What it does |
|---|---|
| Name | Name this stop (optional). Shown in the list and in the bot's console. Without one, the place stands in. |
| Trash icon | Removes the stop, without asking. Undo brings it back. |
| Place | Where the stop is. See below. |
| Only if | A condition checked when the stop comes up. False: the stop is skipped for this lap, which isn't a failure. Without one, it says "Always visited." and Add a condition adds one. |
| If it fails | What happens when the stop fails. See When something fails. |
| Steps | The steps run on each of the stop's maps. See Steps. |
Place starts with a list of five kinds:
| Kind | What you set |
|---|---|
| A map | Map id, typed or picked with Pick on the world map. Under it, the map's coordinates and the name of its world map, or "On no world map (an instance, a house...): shown here only". |
| A zone (painted maps) | Painted with Zone on the world map. It shows how many maps it holds, how many are on no world map, and Show the maps lists them, each with a button to remove it. |
| A subarea | Searched by name, or picked on the world map. Under it, the world map it's on. |
| An area | The same, for an area. |
| A query, found while playing | The fields of a query, as for Query. |
Changing the kind keeps what it can: a map becomes a zone of that one map, a zone becomes a map with its first map, and a map or a zone becomes the subarea of its first map, or a query that starts with that subarea. With nothing to keep, a map, a subarea or an area starts empty, and the stop shows This stop's place hasn't been picked yet. until you pick one. 0 is never put in its place: it's an ID like any other, area 0 being Amakna.
Fields that name game data
A field that asks for a monster, an item, a job, a subarea or any other game data has a Search by name box. Type part of a name and pick it in the list: each entry shows its ID, and the ID shows under the box once picked. A field that takes several, such as a list of monsters, keeps each one you pick. The list says "Type a name to search.", "Nothing by that name." or "The search failed." when it has nothing to show. Names are in the language picked with Language on a Game page.
Fields for a map, a subarea or an area also have Pick on the world map. Click it: the button reads "Click on the world map..." and a bar on the map says what to click, with Cancel. Escape gives up too. For an area, click any square of it. A map has no name to search for: type its ID, or pick it.
Steps
Add a step, on a selected stop, opens the palette. It lists The Studio's blocks first, then the steps each package gives, grouped by package: the package you're editing first, marked "(this package)", then its dependencies in alphabetical order. Each entry has a line of description. Click one to add it at the end of the stop's steps.
The packages offered are the one you edit and those listed in its dependencies. A package that only a dependency uses isn't offered. A dependency that gives nothing here is listed greyed out at the bottom, with the reason:
| Reason | What to do |
|---|---|
| its version in the manifest isn't an exact one | Set an exact version for it in the package's Manifest card. |
| that version isn't installed | Install that version, or change the dependency to one you have. |
| its declarations couldn't be read | The package has an error. See Package errors. |
When the package's own declarations can't be read, the panel shows The package's own blocks couldn't be read with the error, and the palette lacks the package's own steps and conditions until it's fixed.
The palette is read again each time you save, so a step newly declared in the package's code shows up once you save.
The Studio's steps
| Step | Fields | What it does | Fails when |
|---|---|---|---|
| Wait | Seconds, and Up to once turned on | Waits that many seconds, or a random time between Seconds and Up to. Starts at 5 seconds. | Never |
| Wait until | Until, a condition, and Give up after, in seconds, once turned on | Checks the condition at once, then every second until it holds. | Give up after passes first, or the condition can't be answered |
| Play a plan | Plan, another plan of the package | Plays that plan here, from the start of its circuit, then carries on. Before the next step, the bot goes back to the stop's map. | That plan stops on a failure |
| Log | Message | Writes the message in the bot's console. | Never |
| Stop | None | Ends everything being played, as a normal end: this plan, and any plan that is playing it. | Never |
An optional field shows as a switch: turn it on to set it, and turn its switch off again to remove it. Play a plan only offers the package's other plans, and says "The package has no other plan yet." when there are none. A plan played this way counts its own laps.
Steps from packages
A package's step shows its label, followed by the values of its arguments, such as "Gather: Wheat, Barley". Labels and descriptions are in the language the package's author wrote them in. Unfold the step to set its arguments: each is the same field as on the bot's Settings tab (see The fields), with the package's label, description and bounds, and the game data search where the package asks for game data. "Takes no argument." means there's nothing to set.
An argument you haven't changed takes the package's default when the plan plays, so a plan follows the package when its author changes a default. Once you change one, Use the default puts it back. When the package's default can't be used, because it breaks the argument's own rules (a level of at least 1 would start at 0) or because the argument asks for game data and has no default, the field stays empty and the step shows Argument <argument> needs a value. until you set it. From a setting lets the bot's page set it: see Plan settings.
Base's steps
Base gives seven steps that act in the game, with the labels it writes in English:
| Step | Arguments | What it does | Fails when |
|---|---|---|---|
| Gather resources | Resources, Jobs, Never these resources, Only what my job level allows, Order, Most harvests, Stop when bags above | Harvests the resources of the map that match, one after another, the nearest first or the highest level first, with the job's own action. Neither Resources nor Jobs gathers every resource of the map. A fight that comes meanwhile, such as an aggression, is waited for, played by the fight module, and gathering goes on. When nothing matches, there's nothing more to do on this map for a minute. | The character dies in a fight |
| Fight monsters | Only with these monsters, Never with these monsters, Only with these races, Group level at least, Group level at most, Most monsters in a group, Highest monster level, Archmonsters, Most fights | Attacks the monster groups of the map that match, the nearest first, one after another, and waits for each fight's end, which the fight module plays. It switches the module on when it's off, but on a relayed session, where the switch stays yours. When no group matches, there's nothing more to do on this map for a minute. | The character dies in a fight |
| Fight settings | Fight module, Profile, Speed | Sets how the fight module plays while the plan runs: switched on or off, its profile by its name on the Fight Profiles page, and its speed. Keep, or an empty Profile, leaves the bot's own settings. | Profile names a profile that can't be played |
| Rest | Until life reaches, 100% by default, Eat first, Food | Sits the character down until its life is back to that share of its maximum, then stands it up, eating from the bags first with Eat first. A fight meanwhile is waited for, and the rest goes on. Nothing to do when life is already there. | The character dies, or its life stops coming back for a minute |
| Eat | Until life reaches, 100% by default, Food | Eats from the bags until life is back to that share: breads, potions, meats, fish, any item that gives life back, the one that fits what is missing best first, or only the Food given. Nothing to do when life is already there, or the bags hold nothing to eat. | The character dies in a fight meanwhile |
| Equip items | Items | Puts the items on, each in a free slot it can go in, else in its first slot, sending the item there back to the bags. Nothing to do when every one is already worn. | An item isn't in the bags, can't be worn, or the game didn't move it |
| Take items off | Items | Takes the items off, back into the bags, or everything the character wears with none given. Nothing to do when none is worn. | The game didn't move an item |
Every argument of Fight monsters can stay as it is: it then fights every group of the map, but the ones with an archmonster. A group's level is the sum of its monsters' levels, as the game shows it. Archmonsters avoids them by default, allows them, or fights only groups with one.
A plan that farms, for example, has a stop on each map of a zone with Gather resources or Fight monsters, and an interrupt that goes to the bank when Bags above 90%. Since a death puts the character elsewhere, give these steps an If it fails that suits you, and use Died in the last fight to decide what comes next.
A step's card
Each step is a card with a sentence saying what it does, such as "Wait 5 s". Under it, Only if: shows its condition when it has one, and If it fails: always shows what happens when it fails, even when it's the default, Stop the plan.
- Click the card, or its arrow, to unfold it: its arguments or fields, Only if and If it fails.
- Only if is checked right before the step. False: the step is skipped, which isn't a failure. Without one, it says "Always run."
- Drag a card by its grip to move it, or use its arrows. The trash icon removes it, without asking.
Conditions
A condition is a yes or no question. They're used in a stop's Only if, a step's Only if, a Wait until, the circuit's Until, an interrupt's When, and inside other conditions. Add a condition opens the palette of conditions: The Studio's blocks first, then the conditions packages give.
| Condition | Fields | True when |
|---|---|---|
| All of | Conditions | Every one of them is. It starts with one, and Add a condition adds more. |
| Any of | Conditions | At least one of them is. |
| Not | Condition | Its condition isn't. |
| Time played | Minutes | That long has passed since the bot started the plan. In a plan played by another one, it counts from when the first plan started. |
| Laps | Laps, from 1 | The circuit has been completed that many times. |
| Time of day | From, To | The clock of the computer running Asterobot reads from From, included, to To, excluded. A From after To spans midnight: 22:00 to 06:00 is the night. The same time in both is never true. |
| Chance | Chance, from 0 to 100% | A random draw, made again each time the condition is checked, says so. 0 is never true, 100 always is. |
Base gives these conditions about the character, its fights and its harvests, with the labels it writes in English:
| Condition | Arguments | True when |
|---|---|---|
| Level at least | Level, from 1 | The character's level is at least that one. |
| Kamas at least | Kamas | It carries at least that many kamas. |
| Life below | Life, from 1 to 100% | Its life is below that share of its maximum. |
| Bags above | Bags, from 1 to 100% | Its bags are fuller than that share of what they can carry. |
| In a fight | None | A fight is under way. |
| Has an item | Item, searched by name, and How many, 1 by default | It carries at least that many of the item, worn or not. |
| Job level at least | Job, searched by name, and Level, from 1 | That job is at least that level. A job the character doesn't have is level 0. |
| On a map | Map | It stands on that map. |
| In a subarea | Subarea | It stands in that subarea. |
| In an area | Area | It stands in that area. |
| Died in the last fight | None | The character died in its last fight. False before any. |
| Fights at least | Fights, from 1 | The character has fought at least that many fights since the script started. |
| Harvests at least | Harvests, from 1 | The character has made at least that many harvests with Gather resources since the script started. |
| Wears an item | Item, searched by name | The character wears that item. |
The opposite of each is Not around it. A new condition starts with the package's defaults, and most of base's arguments have none they could use: their fields stay empty, and the condition shows Argument <argument> needs a value. until you set them. Only Kamas (0) and How many (1) can be left as they are, and Died in the last fight takes no argument.
Each condition is a card with its sentence, such as "Between 08:00 and 20:00". Unfold it to edit its fields. The arrows button, Change the condition, replaces it with another from the palette. The cross removes it where a condition is optional: a stop's or a step's Only if, and the conditions inside All of and Any of. An interrupt's When, the circuit's Until, a Wait until and a Not always keep one: change it instead.
A condition that can't answer fails, and so does the block it guards. Base's conditions fail this way when the game hasn't told something yet, such as the character's job levels: they never guess. The console then says what's missing, for example the jobs aren't known yet.
When something fails
Every stop and every step has If it fails:
| Choice | Then |
|---|---|
| Stop the plan | The plan stops, with the error in the bot's console. This is the default. |
| Skip it, go on to the next step (for a step), Skip it, go on to the next stop (for a stop) | A line in the console, then the plan carries on. |
| Try again | Tried again up to Tries times, from 1 to 10 (2 to start with), Seconds between tries apart (5 by default). If it still fails, it stops the plan or skips, as you choose. |
A stop that's tried again starts over: its maps are found again and its steps run from the first.
| What | Fails when |
|---|---|
| A step | A package's step reports an error. Its Only if can't be answered. A Wait until gives up, or its condition can't be answered. The plan a Play a plan step plays stops on a failure. An argument's value breaks the package's rules, for example a plan setting whose value is below the argument's minimum. |
| A stop | Its place has no map, or its maps can't be found. No trip reaches any of its maps. A trip to one of its maps fails, including a trip you stop from the bot's Map tab. Its Only if can't be answered. |
| The whole plan, whatever If it fails says | An interrupt's When can't be answered, or the plan the interrupt plays stops on a failure. The circuit's Until can't be answered. |
A failing step doesn't fail its stop: only the step's own If it fails applies.
When the plan stops on a failure, the bot's console gets an error line naming the plan, the stop and the step, and why:
base: Astrub farm › 2 Wheat field (k3f9) › wait until (w4t6) failed: its condition still didn't hold after 60 s
The four characters in parentheses are the block's ID in the plan file. The Studio doesn't show them, but View as code does.
With the index.js that Start with the Studio writes, a plan that stops on a failure stops the script too: the bot's page shows The behavior stopped with an error, with a text starting with unhandled Promise rejection:, followed by the same error. Click Play to start the plan again, from the start of its circuit.
Interrupts
An interrupt plays another plan when a condition holds, then goes back to the circuit or ends it. "When the bags are fuller than 90%, play the bank plan, then resume" is an interrupt. They're on the Interrupts tab. Add an interrupt adds one with these fields:
| Field | What it does |
|---|---|
| Name | Name it (Bank when full). Shown in the bot's console. |
| When | The condition. It starts as "After 60 min of play". |
| Run the plan | Another plan of the package. Until you pick one, the interrupt has the problem No plan chosen. |
| Then | Resume where the circuit was: the bot goes back to the map it was on and runs the step it was about to run. End this plan: the plan the interrupt belongs to ends there. When another plan was playing it, that one carries on. |
Interrupts are checked in their order, on arriving at each map and before each step. Never during a step or a trip: a long step finishes first. The first one whose condition holds plays its plan. While that plan plays, the same interrupt isn't checked again, even from inside it, so "bags full: bank" can't start the bank plan from the bank plan. The interrupts of the plan it plays do apply.
With Resume where the circuit was, the plan it plays has to make the condition false: the bank plan empties the bags. When the condition still holds right after that plan, base stops the plan rather than playing the bank plan again and again, and the console says which interrupt:
base: Astrub farm › interrupt Bank when full (i7w0) is still true after its plan plans/bank.js ran: that plan must make it false, or it would run again and again
A Chance in the condition doesn't count against it, since the next check draws again.
The arrows move an interrupt up or down, and the trash icon removes it. An interrupt needs another plan to play: create it first with plan in Files.
Plan settings
A plan can have settings of its own, which a player sets on the bot's page, such as the monsters to fight or a level to reach. They're on the Settings tab. Add a setting adds one, named setting, holding a whole number, 0 by default.
| Field | What it does |
|---|---|
| Name | The setting's key. Letters, digits and _, not starting with a digit, and not __proto__. It's renamed when you press Enter or leave the box, along with every argument that uses it. A name that's taken or not allowed is refused with " |
| Use count | not used, used once or used 3 times: how many arguments take their value from it. |
| Type | bool (on or off), string (text), int (whole number), double (decimal number), array (list) or map (entries with a key). |
| Holding | For array and map: the type of what they hold. |
| Label | The name the bot's page shows. |
| Game data | For a whole number or a list of them: the game data table the numbers come from, such as monsters, items, sub_areas, areas or maps. The bot's page then offers a search by name. |
| Minimum, Maximum | For numbers. |
| Default value | The value until a player changes it on the bot's page. A setting needs one when it couldn't start at its type's zero: a whole number of at least 1 would start at 0, and a single game data ID at 0, an ID nobody picked. Without one, the field stays empty and the setting shows It needs a default value: without one, it would start at a value it can't run with. |
The trash icon removes a setting. The arguments that used it then show the problem Argument <argument>: the plan has no setting <name>.
Use a setting
Unfold a step or a condition from a package and turn on From a setting under an argument. The argument then takes its value from the plan setting with the same name and type, or from a new one made from the argument itself: its label, its bounds, its game data table, and its current value as the default, or no default when the argument has none it could use. A list then lets you pick another setting of the same type. Turn the switch off to give the argument back the package's default.
Until a player sets another value on the bot's page, the argument takes the setting's default, so that default has to suit the argument: a setting that defaults to 150 can't stand for a percentage. When it doesn't, the step or condition shows Argument <argument>: the default value of setting <setting> doesn't fit: <issue>. A value set on the bot's page is checked when the step or condition runs, and one that doesn't suit the argument fails it.
Only the arguments of packages' steps and conditions can take a setting. The Studio's own blocks take fixed values: a Wait's seconds can't come from a setting.
Show them on the bot's page
A plan's settings reach the bot's Settings tab only once the package's index.js passes them on. The Settings tab of the Studio tells you where you stand:
| What you see | What it means |
|---|---|
| These settings aren't on the bot's page yet, with Add it | index.js doesn't pass them on. Add it writes what does in index.js: a line such as export { parameters } from "./plans/farm.js"; after the imports at the top, or, when index.js already passes on another plan's settings, the merge of both. A notification says "Added to index.js: save to apply it." |
| "index.js re-exports them now: save to see these settings on the bot's page." | index.js passes them on, but isn't saved yet. |
| index.js has settings of its own | index.js declares settings itself, not only plans' settings, and a second parameters would clash with them. The Studio adds nothing and shows the lines to write by hand: The editor explains them. |
Once saved, nothing more is shown. A package started with the Studio already passes on the settings of plans/main.js. Add it works for every other plan too, as long as index.js only gathers plans' settings: it merges the new plan's with those already there. The editor shows what it writes.
On the bot's page, plan settings are package settings like any other, in the package's card on Package settings: see Package settings and actions. A value you apply there is used from the next time an argument reads it, without restarting the plan. When index.js doesn't pass the settings on, the plan uses each setting's default, and the console says so before the bot moves, in one line that names them all:
base: Astrub farm: setting monsters isn't one of the package's settings, so its default is used: re-export the plan's settings from the package's entry
The plans of one package share the bot's values: two plans with a setting of the same name use the same value, so they must give it the same type. When they don't, the setting says "Declared with another type by:" followed by each plan that declares it and its type, and it counts as a problem.
Problems
The Problems tab lists everything wrong with the plan, with a red count on the tab. Each problem says what's wrong and where: Stop 2, Interrupt 1, Setting monsters, Circuit or Plan. Click one to go there. The same sentence shows in red under the block it's about, and the list of stops counts each stop's problems. The editor's error count adds up the problems of every plan to the errors in the code. With none, the tab says "Nothing wrong with this plan."
Saving is allowed with problems, since a plan is often saved half done. Base is what refuses it: when the bot plays it, base checks the whole plan, and every plan it plays, before the bot moves. Even one problem keeps the bot from moving: the console shows can't be run: after the plan's name, followed by every problem base found.
Some of the problems you'll meet:
| Problem | What to do |
|---|---|
The circuit has no stop yet. |
Add a stop. |
No plan chosen. |
Pick the plan for a Play a plan step or an interrupt. |
The plan <path> no longer exists. |
The file was removed. Pick another plan. |
Argument <argument>: <issue>. |
Change the value, such as a number above its maximum. |
Argument <argument> needs a value. |
Set the argument: the package's default can't be used, or there's none. |
Argument <argument>: the plan has no setting <name>. |
The setting was removed or renamed. Pick another, or turn off From a setting. |
Argument <argument>: the default value of setting <setting> doesn't fit: <issue>. |
Change the setting's Default value, or its bounds. |
It needs a default value: without one, it would start at a value it can't run with. |
Give the setting a Default value. |
This stop's place hasn't been picked yet. |
Pick the stop's map, subarea or area. |
The query must name a subarea, an area, a monster, a resource, coordinates or a world map: otherwise it picks every map of the game. |
Turn on one more field of the query. |
The longest wait is shorter than the shortest. |
Up to is below Seconds in a Wait. |
It needs at least one condition. |
An All of or Any of is empty. |
@asterobot:base plays this plan, but the package doesn't depend on it. |
Click Add base to the dependencies in the alert at the top of the panel. |
The setting <name> is declared with different types by the package's plans |
Give it the same type in every plan. |
Locked blocks
A block the Studio can't edit is shown locked: "Read-only: made by a newer Studio, or calling something the package doesn't have", followed by the reason and the block as the file holds it. That happens to a block made by a newer version of the Studio, and to a step or condition from a package that isn't a dependency any more, that gives no blocks here, or that no longer declares that function. The Studio keeps a locked block exactly as it is and saves it unchanged. Fix the cause, such as adding or installing the dependency, or remove the block with its trash icon. A circuit made by a newer Studio says "This circuit was made by a newer Studio: it is kept as it is."
A plan that can't be opened
When a plan file can't be read, the Studio shows This plan can't be opened in the Studio instead of the plan, never writes over the file, and offers Open as code:
| Reason | Cause |
|---|---|
| This plan was made by a newer Studio | A newer Asteroboard wrote it. Asteroboard updates on its own: reload the page once it shows Update available. See Updating. |
| The plan's markers are missing: the file was changed by hand. | Someone edited the file's code. |
| The plan's data can't be read | The plan's data in the file is broken. |
| Part of the plan isn't what the Studio expects | The plan's data has the wrong shape. |
Save, undo and see the code
A plan is one of the package's files. Save, or Ctrl+S, saves it with the others. Unsaved and the dot next to its name in Files work as for code, and nothing asks you to save when you leave the editor: unsaved changes are lost. The editor gives every detail of saving.
Undo and Redo, next to the plan's name, take back changes one at a time. While the Studio has the focus, Ctrl+Z undoes, Ctrl+Shift+Z or Ctrl+Y redoes, and Ctrl+S saves: click in the Studio first. On a Mac, use Cmd. Typing in one field, or one drag of Zone, is one change. Add it is a change to index.js, not to the plan: undo it in index.js's code.
View as code shows the plan file in the code editor, with Back to the Studio above it and a reminder that changes made there by hand are lost the next time the Studio saves the plan. The Studio writes the whole file again each time you change the plan, so make your changes in the Studio.
Play a plan
- In the editor, Run saves the package and starts it on the bot picked next to it. See Run.
- Or set the package on a bot and click Play, as Run a package shows.
The plan waits for the character to stand on its map, checks the whole plan, then sets off. Each start begins at the start of the circuit: the plan doesn't carry on where an earlier run stopped. The bot's Console gets a line at each stop and each step, and for each interrupt, retry, skip, Log step and error:
base: Astrub farm › 1 Wheat field
base: Astrub farm › 1 Wheat field › wait 5 s
base: Astrub farm › 1 Wheat field › wait until
base: Astrub farm › 2 3 maps
While the bot travels, its Map tab shows the trip, as it does for a trip you start yourself. Stopping the trip there makes the stop fail, like any trip that fails.
Stop, on the bot's page, stops the script at once, wherever the plan is. When a time slot of the bot's schedule ends, the plan ends cleanly instead, within the schedule's Time to finish: the step under way finishes, a Wait or Wait until ends at once, and a trip ends once its step under way is over, so the character never stops in the middle of a map change. A Stop step ends the plan the same way, as a normal end.
A One way circuit, or one that ends with Until a condition, ends the plan when it's done. The bot stays where it is.
Note
Coming soon. The Studio will show where a bot is on its plan while it plays. For now, follow it in the bot's Console.
Plans of other packages
Every package's page has a Plans card listing its plans, marketplace packages included. Each line gives the plan's name, its file and its number of stops, or can't be read. "No plan in this package." means there's none.
Open shows the plan in the Studio, read-only, on a page of its own: the world map with the plan drawn on it, and the panel with nothing to change. Select stops to read them, in the list or on the map. The top of the page shows the package, the plan's file and Read-only. For a local package, Edit code opens the plan in the editor. For any package, Copy into... copies it into one of yours.
When the page can't show the plan, it says why: the package's files couldn't be read, the package has no such file, the file isn't a plan, or one of the reasons in A plan that can't be opened.
Copy a plan into your package
- Click Copy into... on the package's page or on the plan's page. The dialog is titled with the plan's file, such as Copy plans/farm.js.
- Pick a Package. Only your local packages are listed. With none, it says "You have no package of your own yet."
- Read what the copy will do. Files lists each plan copied, with the file it becomes in your package. Added to its dependencies lists the packages the plans use that your package doesn't depend on yet, or says "Nothing to add."
- Click Copy and open.
The copy goes into your package's plans folder, with every plan it plays through interrupts and Play a plan steps. A plan whose file name is taken gets a number, such as plans/bank-2.js, and the plans that play it are changed to match. The dependencies are added at the version installed, including the package the plan came from when the plan uses that package's own steps. Both the files and the dependencies are written to your package straight away, without Save, and the editor opens on the copy, which is now yours to change.
| Message | What it means |
|---|---|
| "Not installed, to install before playing the plan:" followed by packages | Packages the plans use that aren't in your library, so they can't be added as dependencies. Install them first. |
| "Referred to but not found, left as they are:" followed by files | Plans the copied plan plays that don't exist in the original package. The copy shows them as problems. |
| "This plan can't be read." | The plan file is broken, so it can't be copied. |
| "That package's files couldn't be read." | Asterobot couldn't read the package you picked. Pick it again, or another one. |
| "The copy failed.", or Asterobot's reason | The copy didn't go through. |
The copy's settings aren't on the bot's page until your index.js passes them on: see Plan settings.
Limits
- A step or a condition from a package only appears when that package declares it for the Studio. If you write packages, Steps and conditions shows how.
- Only the package you edit and its own dependencies, at an exact version that's installed, give blocks.
- Interrupts are never checked during a step or a trip.
- The maps of a subarea, an area or a query are found when the stop comes up, from the game data of the version the bot plays, not the one the Studio shows.
- Time of day reads the clock of the computer running Asterobot, not the time zone of a schedule.
- The Studio's own blocks take fixed values only, never a setting.
- Stops are reached by trips, with the limits described in Travel to another map.
- A change made by hand to a plan file is lost the next time the Studio saves it.
- A marketplace package's plans can be read and copied, never edited.
Where to go next
- Package settings and actions, to set a plan's settings on a bot
- Run a package
- Steps and conditions, to give your own functions to the Studio
- The editor, for what a plan file holds and how code plays it