What asterobot:extension modules will be for, and what happens when a script imports one today.
Extension modules are extra modules that Asterobot will be able to offer scripts, next to the twelve built-in ones, for abilities those don't cover. Their names will start with asterobot:extension/, and a script will import them like any built-in module.
Note
Coming soon. No extension module is available to scripts yet. Until then, a script can use everything the built-in modules described in this reference offer.
Importing one today
A script that imports a module whose name starts with asterobot:extension/ doesn't start. The same goes for any other asterobot: name that isn't a built-in module, such as asterobot:fs. The reason is:
resolve "asterobot:extension/<name>" imported by "<module>": built-in module "asterobot:extension/<name>" is not registered
As for any import that can't be resolved, the toast after Play or Run doesn't show this text. The bot's Settings tab does: Package settings shows Couldn't read this package's settings with the reason. Error messages lists the other texts you can meet there.
The modules a script can import today are:
- asterobot:protocol, to exchange messages with the game;
- asterobot:bot, for the session, the bot's console and disconnecting;
- asterobot:timers, for
sleep(); - asterobot:gamedata, to read game texts and data;
- asterobot:console, to write to Asterobot's log;
- asterobot:runtime, to read package information;
- asterobot:parameters, to read the package's settings;
- asterobot:pathfinding, to find routes and work with cell positions;
- asterobot:movement, to walk the character, take it to the next map and use the elements of its map;
- asterobot:verification, to answer the game server's proof of identity;
- asterobot:character, to read the character's level, kamas, life, pods, items and jobs, and whether it's in a fight;
- asterobot:fight, to drive the fight module, follow fights and take its decisions;
- asterobot:chat, to say things in the game chat through the bot's chat guard;
- asterobot:alarms, to raise events for the alarms' rules and hear the bot's.