Extension modules are extra modules that Asterobot will be able to offer scripts, next to the nine 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.
Aucun avis à afficher.