Feed API
Co moduł klienta gry wysyła i otrzymuje. Każde wywołanie poza pierwszym niesie token z parowania:
Authorization: Bearer <token>Adres bazowy: http://127.0.0.1:8090/api/v1. Opis dla programów jest pod openapi.json.
POST/api/v1/pair
Ask for a pairing code Call it once, when the module has no token yet. Show the code and the link in the game.
Bez tokenu.
Treść zapytania
| Pole | Typ | Opis |
|---|---|---|
characterwymagane | string | The character the client playsdo 30 znaków |
serverwymagane | string | Server slug or name, for example oriondo 60 znaków |
platform | string | Operating system, for example Windows 11do 40 znaków |
module | string | Module name and versiondo 40 znaków |
Odpowiedź
| Pole | Typ | Opis |
|---|---|---|
codewymagane | string | Show it to the player. It is valid for 15 minutes |
urlwymagane | string | Open it to start a guest dashboard, or to add the client to an account |
tokenwymagane | string | The client's secret. Store it; it works once the code is used |
expiresAtwymagane | integer |
POST/api/v1/status
Send the character's state Every 5 to 10 seconds while the client runs. The reply says when to send the next capture.
Treść zapytania
| Pole | Typ | Opis |
|---|---|---|
schema | "vw.status/1" | Payload schema and version |
modulewymagane | string | Name and version of the sending module, for example voidwatch-feed/0.3.0do 40 znaków |
onlinewymagane | boolean | The character is logged in |
characterwymagane | Character | |
character.namewymagane | string | Character namedo 30 znaków |
character.vocation | string | Vocation, for example Elite Knightdo 30 znaków |
character.levelwymagane | integer | ≥ 1, ≤ 5000 |
character.expwymagane | integer | Total experience points≥ 0 |
poswymagane | Position | |
pos.xwymagane | integer | Map x≥ 0, ≤ 65535 |
pos.ywymagane | integer | Map y≥ 0, ≤ 65535 |
pos.zwymagane | integer | Floor, 0 to 15; 7 is ground level≥ 0, ≤ 15 |
cap | integer | Free capacity, in oz≥ 0 |
stamina | integer | Stamina, in minutes≥ 0, ≤ 2520 |
expPerHour | integer | Exp per hour as the client measures it≥ 0 |
route | string | The loaded cavebot routedo 80 znaków |
routeOn | boolean | The cavebot is running |
label | string | The route label the bot is atdo 40 znaków |
routes | string[] | Every route the bot can loaddo 100 elementów |
supplies | Counted[] | do 30 elementów |
supplies[].namewymagane | string | Item or creature name, as the game writes itdo 60 znaków |
supplies[].havewymagane | integer | How many the character has now≥ 0 |
supplies[].wantwymagane | integer | How many the bot keeps in stock, or the task goal≥ 0 |
tasks | Counted[] | do 10 elementów |
tasks[].namewymagane | string | Item or creature name, as the game writes itdo 60 znaków |
tasks[].havewymagane | integer | How many the character has now≥ 0 |
tasks[].wantwymagane | integer | How many the bot keeps in stock, or the task goal≥ 0 |
loot | LootItem[] | do 200 elementów |
loot[].namewymagane | string | Item namedo 60 znaków |
loot[].countwymagane | integer | Looted since the session started≥ 0 |
loot[].sell | integer | NPC price per item, if the module knows it. The server fills it in otherwise≥ 0 |
lootHours | number | Hours since the loot counter started≥ 0 |
skulls | Skull[] | Skulled players in viewdo 20 elementów |
skulls[].namewymagane | string | Player namedo 30 znaków |
skulls[].skullwymagane | "white" | "red" | "black" | "yellow" | "green" | "orange" | Skull colour |
blessed | boolean | Only on servers with blessings |
redemptionLeft | integer | Only on servers with redemption≥ 0 |
Odpowiedź
| Pole | Typ | Opis |
|---|---|---|
okwymagane | boolean | |
statusEverywymagane | integer | Seconds until the next status: 2 while someone watches the character, 30 otherwise |
captureEverywymagane | integer | Seconds until the next capture: short while someone watches or an alert fired |
commandswymagane | integer | Commands waiting; fetch them from /api/v1/commands |
settings | Settings | The player's module settings, for example minimap: true |
GET/api/v1/wait
Wait for a change A long poll: the answer comes the moment someone opens the character on the dashboard, an alert fires or a command is sent, or after `timeout` seconds (at most 25). Keep one open while the client runs, so it switches to the fast pace within a second and costs no requests while nothing happens.
Odpowiedź
| Pole | Typ | Opis |
|---|---|---|
wakewymagane | boolean | True when something changed before the timeout |
statusEverywymagane | integer | |
captureEverywymagane | integer | |
commandswymagane | integer |
POST/api/v1/minimap
Send the minimap file The client's minimap<version>.otmm, as it is on disk, at most 40 MB. It becomes the player's own map for the server. Send it when the file changed and the reply's settings say minimap: true.
Treść zapytania
application/octet-stream
Odpowiedź
any
POST/api/v1/capture
Send a screenshot The game window as JPEG or PNG, at most 2 MB. Send one when /status says so.
Treść zapytania
image/jpeg, image/png
Odpowiedź
any
GET/api/v1/commands
Fetch waiting commands Commands the player sent from the dashboard, oldest first. Fetching marks them as sent.
Odpowiedź
Command[]
POST/api/v1/commands/{cid}/result
Report how a command went
Treść zapytania
| Pole | Typ | Opis |
|---|---|---|
okwymagane | boolean | |
message | string | Shown in the command logdo 200 znaków |
Odpowiedź
any
Błędy
Dane niezgodne ze schematem dostają status 422 z listą wszystkich problemów:
{
"error": "invalid payload",
"problems": [
{
"field": "pos.z",
"message": "Input should be less than or equal to 15"
}
],
"schema": "/developers/schema"
}Status 401 oznacza nieznany token albo klienta, któremu gracz odebrał dostęp. Sparuj ponownie, aby dostać nowy.