Protocole du jeu
Trafic, trouver les messages, écouter, attendre, envoyer, intercepter, valeurs des messages, sessions et mises à jour du jeu
10 archives dans cette catégorie
-
Every property of the traffic object a script receives, what's left of a message Asterobot can't decode, raw bytes and sequence numbers. Every message a script receives comes as a traffic object: in on() and onTraffic() handlers, from wait() and request(), and in interceptors. What a traffic object looks like A chat line on the general channel reaches a handler like this: { sequence: 1842n, direction: "inbound", kind: "event", uid: -1, type: "ChatChannelMessageEvent", wireType: "
- 102 vues
-
Find the message a script needs and the names of its fields with the Dofus protocol reference, the editor's completion and the bot's Network tool. Before writing a handler, you need the name of the message and the names of its fields. Three tools give you those, and each one is best at a different question: Tool Best for The Dofus protocol reference Learning what a message is for and what each field holds. The editor's completion Writing names and fields correctly while you type. Th
- 108 vues
-
Receive messages with on() and onTraffic(), choose them with selectors, and know the order handlers run in, how to remove them, their limits and what stops a script. A script spends most of its time waiting for the game to say something. on() and onTraffic() register functions that Asterobot calls for each message, until you remove them or the script stops. React to messages builds a first handler; this page covers everything else. on() const handle = on(selector, handler); on() registers han
- 96 vues
-
Pause a script until a message arrives with wait(), always with a timeout, wait for the answer to what you send, and handle what can go wrong. wait() pauses your code until a message you describe arrives, and hands you that message. It's the tool for "do something, then carry on when the game answers". wait() const traffic = await wait(selector, { timeout: 5000 }); wait() returns a promise that resolves with the traffic object of the next message matching selector. The selector is the same as
- 76 vues
-
Send messages to the game server or to the Dofus client with send(), use request() for the few requests that get a response, and understand order, timeouts and errors. A script acts in the game by sending the messages the Dofus client would send. send() does that for almost everything, request() is for the few requests the game answers with a response, and the to option turns a message around, towards the client. Send messages builds a first example. Warning Everything a script sends goes out
- 128 vues
-
Let messages through, drop them or change them on their way through the bot with intercept(), how a message waits for your answer, and use it safely on a MITM bot. Every other function in this chapter observes messages that have already gone through. An interceptor is asked first, and its answer decides whether a message continues, and in what form. On a MITM bot (man-in-the-middle: the bot relays the game session of the Dofus client you play), that decides what your Dofus client and the game s
- 76 vues
-
How message fields become JavaScript values and back, from field names, BigInt and enums to lists, maps, nested messages, oneofs, missing fields and every payload error. A message's fields travel as protobuf values, and scripts work with JavaScript values. Asterobot converts them both ways: when a script reads traffic.payload, and when it builds a payload for send(), request() or an interceptor's { payload }. The two directions aren't symmetric, and this page lists every rule. The Dofus protoc
- 84 vues
-
What session tells a script, how Full socket and MITM bots differ for a script, sharing a character with the person playing, and what disconnect() does. A script runs on one bot's game connection, its session. session, from asterobot:bot, describes it, and a few things work differently on a Full socket bot and on a MITM bot. How bots talk to Dofus explains both modes; this page covers what they change for your code. session import { session } from "asterobot:bot"; Field Value What it holds
- 97 vues
-
What changes for scripts when Ankama patches Dofus, what messages look like while Asterobot doesn't know the new version, and how to write scripts that keep working. Ankama patches Dofus regularly, and a patch can change the game's messages. Asterobot absorbs most of those changes before they reach scripts, but not all of them. What a patch changes Messages carry scrambled names on the wire, and those names change between game versions. Asterobot translates them into readable names, so as lon
- 102 vues
-
How scripts and Asterobot's fight module share a bot's fights: starting a fight from a script, knowing when it starts and ends, driving the module and taking its decisions, what the module sends and holds back, and what a script must send when the module is off. Asterobot has a fight module that plays a bot's fights by itself, when the person running the bot switches it on: it places the character, says it's ready, plays every turn and answers everything the Dofus client answers during a fight.
- 60 vues