From 065d091dbf12e8cfe1b4f172927671926104e275 Mon Sep 17 00:00:00 2001 From: max bittker Date: Wed, 4 Feb 2026 10:50:42 -0500 Subject: [PATCH] readme --- .vscode/settings.json | 3 +++ README.md | 15 ++++++++++++++- webclient/src/bot/StateCollector.ts | 9 ++------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 69c3731cd..fbabe54d6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,4 +3,7 @@ "**/.git": true, "**/node_modules": true }, + "cSpell.enabledFileTypes": { + "markdown": true + }, } \ No newline at end of file diff --git a/README.md b/README.md index fa7539841..177112230 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ There is currently a [leaderboard](https://rs-sdk-demo.fly.dev/hiscores) for bot git clone https://github.com/MaxBittker/rs-sdk.git ``` -Out of the box, you can connect to the provided demo server, but be sure to chose a name that is not already taken! +Out of the box, you can connect to the provided demo server, choose a name that is not already taken! With claude code: ```sh @@ -67,6 +67,19 @@ cd webclient && bun run watch cd gateway && bun run gateway ``` there is also a login server which you may not need + +## Architecture: + +rs-sdk runs against an enhanced web-based client (`botclient`) which connects to the LostCity 2004scape server emulator. + +There is a gateway server which accepts connections from botclient and SDK instances, and forwards messages between them based on username. +Once connected to the gateway, the botclient will relay game state to the SDK, and execute low level actions (e.g. `walkTo(x,y)`) sent from the gateway. + +This means that the SDK can't talk directly to the game server, but must go through the botclient. It will attempt to launch the botclient on startup if one is not already running. + +You don't need to run the gateway/botclient in order to run automations against the demo server, but you may choose to if you are fixing bugs or adding features to the rs-sdk project + + ## Disclaimer This is a free, open-source, community-run project. diff --git a/webclient/src/bot/StateCollector.ts b/webclient/src/bot/StateCollector.ts index 7e04bbc52..632a62ef4 100644 --- a/webclient/src/bot/StateCollector.ts +++ b/webclient/src/bot/StateCollector.ts @@ -811,16 +811,12 @@ export class BotStateCollector implements ScanProvider { const messageType = c.messageType || []; const messageTick = c.messageTick || []; - // Message types to filter out (other players' chat) - // Type 2 = public chat, Type 3 = private message received - const filteredTypes = new Set([2, 3]); - - // Get recent messages, filtering out other players' chat + // Get recent messages (up to 5) for (let i = 0; i < 10; i++) { const text = messageText[i]; const type = messageType[i] || 0; - if (text && !filteredTypes.has(type)) { + if (text) { messages.push({ type: type, text: text, @@ -829,7 +825,6 @@ export class BotStateCollector implements ScanProvider { }); } - // Stop once we have 5 non-filtered messages if (messages.length >= 5) break; }