RS-SDK

repository·main·Indexed 20 days ago

https://github.com/maxbittker/rs-sdk

A research-oriented starter kit for building and testing RuneScape-style bots. It features a TypeScript SDK, a server emulator based on LostCity, and an agent-friendly environment for studying goal-directed program synthesis. The SDK provides a two-layer API: a low-level 'Plumbing' layer (BotSDK) for protocol mapping and a high-level 'Porcelain' layer (BotActions) for domain-aware gameplay actions. It includes an MCP server for integration with tools like Claude Code.

Tokens
382.4K
Snippets
1K
Records
4.1K
Agent score
69%

What's inside rs-sdk

  1. Overview of RS-SDK components

    main

    The RS-SDK repository contains the full stack required to run and automate the game environment:

    • BotSDK (sdk/): A library used for writing automation scripts in TypeScript.
    • Game Server (server/engine/): Handles world state, players, NPCs, and game logic.
    • Web Client (server/webclient/): A TypeScript-based browser client, including modules for BotSDK automation.
    • Gateway (server/gateway/): A WebSocket relay service that connects browser game clients to SDK agents.

    Most users can build bots by simply writing scripts using the botsdk library without needing to modify the server or client code.

  2. Use the Lite client for headless RS274 botting

    main

    The LiteClient is a headless, high-performance RS274 client designed for running many bots on a single machine. It implements the same protocol and game state as the full browser client but removes all rendering (no 3D, no textures, no sound, no screenshots).

    Key Characteristics:

    • Low Resource Usage: Approximately 13.8 MB RAM and 0.42% CPU per bot (measured on M-series hardware).
    • Compatibility: It acts as a façade for the ~54 methods and ~36 fields used by the bot bridge, ensuring that BotWorldState is produced by the exact same logic as the browser client.
    • Headless: It does not fetch models, animations, or music. Map data is loaded once from /ondemand.zip during the index build.
    • Accuracy: Entity positions are snapped to grid coordinates (x/z) rather than interpolated for efficiency and accuracy.
    import { startSession } from '#/lite/session.js';
    
    const s = await startSession({
        host: 'rs-sdk-demo.fly.dev',
        username,
        password,
        // Anything other than 'stopped' means the bot left the game on its own.
        onEnd: end => console.warn(`session over: ${end.reason}`)
    });
    
    s.client.walkTo(3222, 3218, true);
    s.client.flush();
    
    // ...
    
    s.stop();
    const { reason } = await s.stopped;
  3. Understand Prayer mechanics and recharging

    main
    The Prayer skill provides combat-enhancing abilities that drain prayer points over time. The rate of depletion increases with the number of active prayers and the level of the prayers being used. To fully restore prayer points, use a church altar.