Lewati ke konten utama

Reading inbound packets

The runtime parses every inbound BSON document and routes known IDs to internal handlers. Lua scripts receive post-parse state via the relevant getters (client:inventory(), client:position(), etc.) — you don't see the raw packet stream from Lua.

Subscribing to specific packets

If you need raw packet visibility for a specific ID, register an event with client:on:

client:on("p:Chat", function(msg)
print(string.format("[chat] %s: %s", msg.user or "?", msg.text or ""))
end)

The p:<ID> form fires only on packets with matching ID field. Use p (no suffix) to catch every inbound packet.

Subscribing to lifecycle events

client:on("connect", function() print("bot in world") end)
client:on("disconnect", function(reason) print("dropped: " .. reason) end)

Full event list lives in Events.

Tail of all inbound traffic

For full-stream visibility (debugging unknown packet shapes), the desktop app's Logs page tails the same hub the runtime publishes events to.