Feed API

O que um módulo do cliente envia e recebe. Toda chamada, menos a primeira, leva o token do pareamento:

Authorization: Bearer <token>

Endereço base: http://127.0.0.1:8090/api/v1. A descrição para máquinas está em 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.

Não precisa de token.

Corpo da requisição

CampoTipoDescrição
characterobrigatóriostringThe character the client playsaté 30 caracteres
serverobrigatóriostringServer slug or name, for example orionaté 60 caracteres
platformstringOperating system, for example Windows 11até 40 caracteres
modulestringModule name and versionaté 40 caracteres

Resposta

CampoTipoDescrição
codeobrigatóriostringShow it to the player. It is valid for 15 minutes
urlobrigatóriostringOpen it to start a guest dashboard, or to add the client to an account
tokenobrigatóriostringThe client's secret. Store it; it works once the code is used
expiresAtobrigatóriointeger

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.

Corpo da requisição

CampoTipoDescrição
schema"vw.status/1"Payload schema and version
moduleobrigatóriostringName and version of the sending module, for example voidwatch-feed/0.3.0até 40 caracteres
onlineobrigatóriobooleanThe character is logged in
characterobrigatórioCharacter
character.nameobrigatóriostringCharacter nameaté 30 caracteres
character.vocationstringVocation, for example Elite Knightaté 30 caracteres
character.levelobrigatóriointeger≥ 1, ≤ 5000
character.expobrigatóriointegerTotal experience points≥ 0
posobrigatórioPosition
pos.xobrigatóriointegerMap x≥ 0, ≤ 65535
pos.yobrigatóriointegerMap y≥ 0, ≤ 65535
pos.zobrigatóriointegerFloor, 0 to 15; 7 is ground level≥ 0, ≤ 15
capintegerFree capacity, in oz≥ 0
staminaintegerStamina, in minutes≥ 0, ≤ 2520
expPerHourintegerExp per hour as the client measures it≥ 0
routestringThe loaded cavebot routeaté 80 caracteres
routeOnbooleanThe cavebot is running
labelstringThe route label the bot is ataté 40 caracteres
routesstring[]Every route the bot can loadaté 100 itens
suppliesCounted[]até 30 itens
supplies[].nameobrigatóriostringItem or creature name, as the game writes itaté 60 caracteres
supplies[].haveobrigatóriointegerHow many the character has now≥ 0
supplies[].wantobrigatóriointegerHow many the bot keeps in stock, or the task goal≥ 0
tasksCounted[]até 10 itens
tasks[].nameobrigatóriostringItem or creature name, as the game writes itaté 60 caracteres
tasks[].haveobrigatóriointegerHow many the character has now≥ 0
tasks[].wantobrigatóriointegerHow many the bot keeps in stock, or the task goal≥ 0
lootLootItem[]até 200 itens
loot[].nameobrigatóriostringItem nameaté 60 caracteres
loot[].countobrigatóriointegerLooted since the session started≥ 0
loot[].sellintegerNPC price per item, if the module knows it. The server fills it in otherwise≥ 0
lootHoursnumberHours since the loot counter started≥ 0
skullsSkull[]Skulled players in viewaté 20 itens
skulls[].nameobrigatóriostringPlayer nameaté 30 caracteres
skulls[].skullobrigatório"white" | "red" | "black" | "yellow" | "green" | "orange"Skull colour
blessedbooleanOnly on servers with blessings
redemptionLeftintegerOnly on servers with redemption≥ 0

Resposta

CampoTipoDescrição
okobrigatórioboolean
statusEveryobrigatóriointegerSeconds until the next status: 2 while someone watches the character, 30 otherwise
captureEveryobrigatóriointegerSeconds until the next capture: short while someone watches or an alert fired
commandsobrigatóriointegerCommands waiting; fetch them from /api/v1/commands
settingsSettingsThe 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.

Resposta

CampoTipoDescrição
wakeobrigatóriobooleanTrue when something changed before the timeout
statusEveryobrigatóriointeger
captureEveryobrigatóriointeger
commandsobrigatóriointeger

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.

Corpo da requisição

application/octet-stream

Resposta

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.

Corpo da requisição

image/jpeg, image/png

Resposta

any

GET/api/v1/commands

Fetch waiting commands Commands the player sent from the dashboard, oldest first. Fetching marks them as sent.

Resposta

Command[]

POST/api/v1/commands/{cid}/result

Report how a command went

Corpo da requisição

CampoTipoDescrição
okobrigatórioboolean
messagestringShown in the command logaté 200 caracteres

Resposta

any

Erros

Dados fora do esquema recebem status 422 com todos os problemas listados:

{
  "error": "invalid payload",
  "problems": [
    {
      "field": "pos.z",
      "message": "Input should be less than or equal to 15"
    }
  ],
  "schema": "/developers/schema"
}

Status 401 significa que o token é desconhecido ou que o jogador revogou o cliente. Pareie de novo para ter um novo.