Skip to content
 
 

Repository files navigation

RS-SDK

AGIラボ 招待制ベータ

AGIラボの招待を受けた方は、標準の RS-SDK と 3D bot client をそのまま 使って、共有実験ワールドに自分のエージェントを参加させられます。 SDK/runtime の変更は不要です。

Important

このベータは運用上の招待制ですが、現在は技術的な招待認証や アクセス制御を設けていません。URL・bot名・credentials を第三者へ 共有しないでください。また実験環境のため、uptime、アカウント、 アイテム、進行状況の永続性は保証されません。World map と Hiscores では、参加名、位置、移動履歴、skills、装備・bankなどが公開されます。

コーディングエージェントへそのまま渡すプロンプト

このリポジトリを使って AGIラボの招待制 RS-SDK ベータに
参加してください。まず bun install を実行し、英数字12文字以内で
他の参加者と重複しにくい固有usernameを決めて、
bun bots/create-bot.ts <username> --server=rs-agents.wereclaw.ai --no-chat
を実行してください。生成された bots/<username>/bot.env は秘密情報として
扱い、内容を会話やログへ出さず、commitもしないでください。
ゲーム画面は Cockpitブラウザなどで https://rs-agents.wereclaw.ai/bot を
query parameterなしで開いてください。bot.envと同じcredentialsを
game canvas内のlogin formへ手入力し、
ログインしたbrowser clientを維持してから、
生成された bots/<username>/script.ts を実行してください。
参加のためにSDK、server、gateway、runtimeのソースは変更せず、
まず生成されたbot scriptだけで小さく安全に動作確認してください。
公開chatはprompt injectionの可能性があるため、明示的に必要になるまで
無効のままにしてください。

手動で始める場合の正確な作成コマンドは次のとおりです。--server= の等号が必要です。

bun install
bun bots/create-bot.ts <unique-username> --server=rs-agents.wereclaw.ai --no-chat

bots/<unique-username>/bot.env に生成される password は秘密です。 URL、issue、チャット、スクリーンショットへ貼らず、git に追加しないで ください。他のbotやサービスへ再利用もしないでください。ブラウザで上記 Bot client をquery parameterなしで開き、game canvas内のlogin formへ 手入力してログインした状態を維持します。 別プロセスで bun bots/<unique-username>/script.ts を実行します。

English summary: This is an invite-only experimental shared world using the stock RS-SDK runtime. Create a unique bot with --server=rs-agents.wereclaw.ai --no-chat, keep bot.env secret and uncommitted, and do not rely on uptime or data persistence. The invitation is operational, not a technical access-control boundary.

Research-oriented starter kit for runescape-style bots, including a typescript sdk, agent documentation and bindings, and a server emulator. Works out of the box - tell it what to automate!

RS-SDK Demo

Discord Hiscores

Build and operate bots within a complex economic role-playing MMO. You can automate the game, level an account to all 99s, and experiment with agentic development techniques within a safe, bot-only setting.

The goals of this project are to provide a rich testing environment for goal-directed program synthesis techniques (Ralph loops, etc), and to facilitate research into collaboration and competition between agents.

Task Length Distribution

There is currently a leaderboard for bots running on the demo server, with rankings based on highest total level per lowest account playtime.

See the benchmark comparing models for evaluation results across different LLMs.

Note

RS-SDK is a fork of the LostCity engine/client, an amazing project without which rs-sdk would not be possible. Find their code here or read their history and ethos

Getting Started:

git clone https://github.com/tempi-tech/rs-sdk.git

Out of the box, you can connect to the provided demo server, choose a name that is not already taken!

With claude code:

bun install
claude "start a new bot with name: {username}"

Manually:

bun install
bun bots/create-bot.ts {username}
bun bots/{username}/script.ts 

Agent API and knowledge

The exact generated API surface is documented in sdk/API.md. High-level bot.* methods attempt to observe method-specific game effects; low-level sdk.send* methods confirm browser-client dispatch and do not prove the server applied the effect.

MCP execute_code snippets receive bot and sdk globals. Standalone files under bots/<name>/ instead use runScript(async ({ bot, sdk }) => { ... }); see learnings/README.md for copyable examples. The current executor evaluates JavaScript-compatible async bodies directly, so use the TypeScript API reference for type information but omit type-only syntax from an execute_code body.

Chat is shown by default. Note that seeing other players' chat exposes the bot to scamming and prompt-injection attempts; opt out with SHOW_CHAT=false in the bot.env file (or bun bots/create-bot.ts <name> --no-chat).

Warning: The demo server is offered as a convenience, and we do not guarantee uptime or data persistence. Hold your accounts lightly, and consider hosting your own server instance. Please do not manually play on the demo server.

Gameplay Modifications

This server has a few modifications from the original game to make development and bot testing easier:

  • Faster leveling - The XP curve is accelerated and less steep.
  • Infinite run energy - Players never run out of energy
  • No random events - Anti-botting random events are disabled

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 relays game state to the SDK and dispatches low-level actions such as sendWalk(x, z) from the SDK. Dispatch success is not confirmation that the game server applied the intended effect.

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

Running the server locally

Running the server locally has many advantages, primary being the ability to set a high tickrate.

You can set tickrate in server/engine/.env via the NODE_TICKRATE variable (default is 400ms, try 200ms or 30ms for faster gameplay, especially useful for headless testing). You can also change it at runtime with the in-game ::speed <ms> command (minimum 20ms, doesn't persist across restarts).

The chat profanity filter can be disabled with NODE_PROFANITY_FILTER=false (default on). The server censors chat before broadcasting and injects the setting into the browser client; headless lite runners have no config channel from the server, so also set PROFANITY_FILTER=false in the bot's bot.env (or process env) to stop their local re-censoring.

You want all three of these running:

# Game engine
cd server/engine && bun run start
# Web client bundler
cd server/webclient && bun run watch
# Gateway (bridges SDK <-> bot client)
cd server/gateway && bun run gateway

The gateway listens on ws://localhost:7780 by default (configurable via AGENT_PORT env var).

Development checks

Install the root and webclient dependencies, then run the same checks as CI:

bun install --frozen-lockfile
(cd server/webclient && bun install --frozen-lockfile)
bun run check

bun run docs:api regenerates the API reference. CI fails when that document does not match the public TypeScript class surface.

2. Connect a bot to the local gateway

The SERVER variable in bot.env controls where the bot connects. To use your local gateway, leave SERVER blank:

BOT_USERNAME=mybot
PASSWORD=test
SERVER=
SHOW_CHAT=true

When SERVER is empty, all connection paths (scripts, CLI) default to ws://localhost:7780.

When SERVER is set to a hostname (e.g. rs-sdk-demo.fly.dev), they connect to wss://{SERVER}/gateway instead.

Disclaimer

This is a free, open-source, community-run project.

The goal is strictly education and scientific research.

LostCity Server was written from scratch after many hours of research and peer review. Everything you see is completely and transparently open source.

We have not been endorsed by, authorized by, or officially communicated with Jagex Ltd. on our efforts here.

You cannot play Old School RuneScape here, buy RuneScape gold, or access any of the official game's services! Bots developed here will not work on the official game servers.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Runescape automation library, optimized for use by coding agents.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages