Reference
Chaque module et chaque fonction, les déclarations, les limites et les messages d'erreur
20 archives dans cette catégorie
-
Every function of asterobot:protocol with its parameters, return value and exact errors, plus the traffic object, payload values and interception decisions. asterobot:protocol is how a script exchanges messages with the game: it sends them, waits for them, reacts to them, and changes or blocks them on their way through. Listening, Waiting, Sending and Intercepting explain how to use each part. import { send, request, wait, on, onTraffic, intercept, off } from "asterobot:protocol"; These are th
- 127 vues
-
The launch object, the session a script runs on, the map its character stands on, the memory its scripts share, disconnect(), onStopRequest(), and the four functions that write to the bot's console. asterobot:bot gives a script what belongs to its own bot: the facts about the game session, the map its character stands on, a memory every script on the bot shares, a way to close the game connection, a way to hear that the bot's schedule wants it to stop, and the bot's console. The launch argument
- 128 vues
-
sleep(), the only timer scripts have, with its argument, how it rejects, and how to repeat a task on a schedule. asterobot:timers has a single export, sleep(). Scripts have no setTimeout() or setInterval(), so pauses, delays and repeated tasks are all built with it. import { sleep } from "asterobot:timers"; sleep() sleep(milliseconds) returns Promise<void>. Parameter Type Description milliseconds number How long to wait. 0 and fractions such as 2.5 are accepted. The promise r
- 69 vues
-
text, record, table, find, search and query, which read the game's texts and data from a script, with every option, return shape, limit and error. asterobot:gamedata reads the texts and the data of the game version the bot uses: items, monsters, maps, spells and everything else Asterobot extracts from the game files. It only reads. Game data overview, Lookups and SQL show how to use it. import { text, record, table, find, search, query } from "asterobot:gamedata"; These are the module's only e
- 87 vues
-
The functions that write to Asterobot's own log instead of the bot's console, where their lines appear, and how values print. asterobot:console writes to Asterobot's own log, the one shown in Server > Console and in the terminal Asterobot runs in. It's for a script's diagnostics. To show something to the person watching a bot, use botInfo() and the other functions of asterobot:bot instead: they write to that bot's own console. import { console, debug, log, info, warn, error } from "asterobo
- 61 vues
-
packages.info(), which tells a script the name, version, origin, integrity, permissions and compatibility of its own package, its dependencies and the built-in modules. asterobot:runtime lets a script read facts about the packages it's made of: its own package, the packages it depends on, and the built-in asterobot: modules. Nothing in it can change a package. import { packages } from "asterobot:runtime"; packages is the module's only export. It's a frozen object with one function, info(). The
- 61 vues
-
values, onChange and offChange, which give a script its package's current settings, with the value types and when changes arrive. asterobot:parameters gives a script the current values of its package's settings: the ones declared with export const parameters and shown on the bot's Settings tab, under Package settings. Declarations describes how to declare them, and Read settings shows how to use them. import { values, onChange, offChange } from "asterobot:parameters"; Whose settings Each pack
- 63 vues
-
findPath, cellToPoint, pointToCell, distance and direction, which find the route the Dofus client would walk on a map and work with cell positions, with every option, return shape and error. asterobot:pathfinding computes moves on a map the way the Dofus client does. findPath() gives the route the client would walk from one cell to another, the key cells to send for it and how long the walk lasts. The other functions work with cell positions: where a cell sits on the map's grid, and the distanc
- 142 vues
-
move(), changeMap(), useElement(), travel() and the map finders, which walk the bot's character on its map, take it to the next map by a side, use the doors, zaaps, resources and exits of the map, take it to any map however far and find the maps to go to, on Full socket and MITM bots alike, with every option, error and limit. asterobot:movement moves the bot's character the way the Dofus client does when the player clicks: move() walks the character to a cell of the map it stands on; changeM
- 135 vues
-
The official package that does what the Dofus client does by itself, starting as soon as a script loads it, and the standard library packages build on: moving, the Studio's plans, steps and conditions for gathering, fighting, resting, equipment, the marketplace and the bank, and 24 fight profiles. @asterobot:base is the official package that does what the Dofus client does by itself, so that your package never has to: it identifies the game connection, picks a character and enters the world;
- 121 vues
-
The exact schema of export const parameters, actions, steps and conditions, with every field, the six types, defaults, choices, bounds, ref, how Asterobot reads them and every validation error. A package puts settings and buttons on a bot's page, and gives steps and conditions to the Studio, by declaring them in its script. The complete schema is below. Declare settings, Declare actions and Steps and conditions walk through it with examples, and asterobot:parameters describes how a script reads
- 86 vues
-
Every limit Asterobot sets on scripts, with its value and exactly what happens when a script goes past it. Asterobot runs every script within fixed limits, so that one script can't hold up Asterobot or the other bots. They're the same for every bot and every package, and a package can't change them. None of them depends on the speed of the PC: a slower PC makes a script slower, never different. Here is each one, with its value and what happens past it. Running code Limit Value Past the lim
- 84 vues
-
Every error text a script author can meet, grouped by where it appears, with its cause and how to fix it. The error texts you can meet while writing and running scripts are grouped here by where they appear. Search for a part of the text you see. In the texts, a word in angle brackets such as <module> stands for something that changes: <module> is the path of a file inside Asterobot, such as library/my-first-script/1.0.0/index.js, <type> a message's name, <field> a field
- 70 vues
-
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
- 65 vues
-
commitment(), publicKey() and proof(), which compute the bot's answers to the proof of identity the game server asks for on each game connection, with when to call each one and every error. Once a game session is open, the game server asks the client to prove who it is, in three exchanges. asterobot:verification computes what the bot answers with. Your script sends the messages, and the secrets behind the answers stay inside Asterobot: your code only ever sees the values that go on the wire. O
- 57 vues
-
character(), items(), itemCount() and jobLevel(), which tell a script its character's level, kamas, energy, life, pods, whether it's in a fight, its items and its jobs, with when each one is known and every error. asterobot:character tells your script what the game has said about its character: level, kamas, energy, life, how full its bags are, whether it's in a fight, its items and its job levels. Use it to decide what to do next, such as going to the bank when the bags are nearly full or rest
- 63 vues
-
The exact JSON format of a fight profile, every field with its type, values and default, conditions, actions and targets, how extends merges, and every error and warning Asterobot reports. A fight profile is a JSON object. Players write them on the Fight Profiles page, where the editor shows the same JSON (Fight profiles), and packages ship them as files, one per profile, in their fightprofiles folder (Ship fight profiles). This page is the complete format. What each setting does in a fight is
- 47 vues
-
Drive the fight module from a script: switch it on or off, change its profile and speed, read the fight under way, follow every fight's events, and take its decisions yourself at the placement, ready and each action of a turn, with the rules engine checking every action. asterobot:fight lets your script work with the bot's fight module, which plays its fights as its fight profile says. The guide describes the module for players: The fight module. import { enable, disable, enabled, setProfi
- 70 vues
-
Say things in the game chat from a script through the bot's chat guard, which waits out a channel's cooldown and keeps to the server's limits, with templates that pick random wording, fill in the character's level, map or kamas, and link items from its inventory; switch the bot's chat module and pick its chat profiles while the script runs; answer the private messages the bot gets, and hear what the module does. asterobot:chat lets your script say things in the game chat through the bot's chat
- 21 vues
-
Raise an event of your own from a script for the alarms' rules to take, such as an item found under a price, and hear every event of the bot as it happens: a member of staff, a whisper, the character's name said, the chat module's events, a trigger's, and the game messages the rules hook. asterobot:alarms connects your script to the bot's alarms. It raises events of its own, which the rules on the Alarms page take like any other, and it hears every event of the bot as it happens, whatever the r
- 17 vues