Skip to content

Guides

How RuneScape bots work

A bot is a client plus a script. What each part does, how a script decides its next move many times a second, and why good scripts stop rather than guess.

By Project X teamPublished 5 min read

How RuneScape bots work: Project X article cover
In this article
  1. The two parts of a bot
  2. The loop: look, decide, act, wait
  3. Walking around the world
  4. Doing work without freezing the game
  5. Stopping safely
  6. Where scripts come from
  7. Questions about how bots work

A RuneScape bot is two things working together: a client that can see the game and send input to it, and a script that decides what to do. The client is the same for every activity; the script is what makes one bot fish and another fight a boss. This article explains both, and how a script turns what it sees into the next click.

The two parts of a bot

The client: eyes and hands

A script can only act on what the client exposes. A bot client gives scripts structured access to the game state: who and what is nearby, what is in the inventory and bank, which interface is open, the player's position, health, prayer and run energy. It also provides a way to act on it, such as clicking an object, choosing a menu option or typing.

Clients get that access in different ways. Some are built on an existing game client and add a scripting layer to it. On Old School RuneScape, the Project X client is built on RuneLite, the open-source third-party client, and a script is a RuneLite plugin with extra scripting tools. On RuneScape 3, the Project X launcher starts Jagex's own client and loads a scripting engine into it, with an in-game overlay for starting and configuring scripts.

The script: the decisions

The script is the logic for one job: chop willows and bank them, kill a boss and restock, complete a minigame round. It is ordinary program code. On OSRS with Project X it is written in Java against the client's API; on RS3 it is a Kotlin class written against a separate script API. The two are not interchangeable, which is why every store keeps the games apart.

The loop: look, decide, act, wait

Almost every script is a loop that runs many times a second:

  1. Look. Read the current state of the game: is the inventory full, is the bank open, is the player under attack, where is the nearest tree?
  2. Decide. Pick the one thing that should happen next, from what the game shows now rather than from what the script assumed last time.
  3. Act. Do it: walk, click, choose a menu option.
  4. Wait. Wait until the action has had its effect, then go round again.

The game itself advances in fixed steps called ticks, each 0.6 seconds long, so the world a script sees only changes a little between one tick and the next. Good scripts wait for a condition ("until the bank is open", with a time limit) rather than for a fixed number of seconds, so they move on as soon as the game is ready and notice when it never becomes ready.

States: how a script knows what it is doing

Simple scripts are a list of rules checked in order ("if the inventory is full, bank; else if no tree is near, walk to trees; else chop"). Larger ones, such as boss scripts, organise the rules into states (travelling, preparing, fighting, looting, restocking) and move between them on clear conditions. The structure matters less than the principle: every decision comes from something the script can see.

Walking around the world

Getting from the bank to a boss involves doors, stairs, agility shortcuts, teleports, boats and quest-locked routes. Scripts rarely plan this themselves. They ask a shared pathfinder, called a web walker, for a route. It knows which tiles can be walked on and which transports link them, and it skips the routes the player cannot use yet. When the game adds new areas, the walker's map data has to be updated before scripts can travel there.

Doing work without freezing the game

The game client draws the screen and processes game events on its own thread. A script runs on a separate thread, so a script that is waiting does not freeze the picture. That split creates the most common class of hard bugs: reading game data from the wrong thread, or blocking the game's thread with a wait. Our threading guide for developers covers the rules in detail.

Stopping safely

The worst thing a script can do is carry on in a broken state: clicking the same thing forever, or standing in danger because an assumption failed. Well-built scripts check preconditions before each step, retry a failed step a limited number of times, try a recovery (walk back, re-open the bank), and stop with a clear message when they cannot continue, for example when supplies run out or a requirement is missing. Project X gives OSRS scripts a shared reliability toolkit for exactly this.

Where scripts come from

Scripts are written by developers and usually distributed through a store attached to the client. On Project X every script is submitted with its source code and read by a person before it is listed; how scripts are reviewed explains the process. Players browse them in the OSRS script store and the RS3 script store.

Questions about how bots work

Does a bot read the screen like a person?

Some do. Older and simpler bots, often called colour bots, find things by looking at the colours of pixels on the screen. Client-based bots like Project X read the game's own data instead, which is more precise: the script knows an object's name and position rather than guessing from its colour.

Can one script work in both OSRS and RS3?

No. The games have different clients, different interfaces and different content, and the scripts are written against different APIs. A script is always written for one game.

Why do scripts break after a game update?

Updates can change interfaces, object ids, map areas or game mechanics that a script relies on. The script then needs its developer to update it. Good stores mark a broken script and stop selling it until it is fixed.

Do I need to know how to program to use a bot?

No. Players pick a script, adjust its settings in a panel and start it. Programming is only needed to write scripts; if you want to, the developer docs start from a working template.

  • OSRS vs RS3 botting: the key differences: Project X article cover

    Guides

    OSRS vs RS3 botting: the key differences

    Botting OSRS and botting RS3 use different software, different scripts and different content. A side-by-side look at what changes between the two games and what does not.

    · 3 min read

  • What is RuneScape botting?: Project X article cover

    Guides

    What is RuneScape botting?

    Botting means letting software play RuneScape for you. The kinds of bots there are, why people use them, what a bot client is, and the rule that applies to all of them.

    · 3 min read

  • Is botting allowed in OSRS and RS3?: Project X article cover

    Guides

    Is botting allowed in OSRS and RS3?

    No. Bots are against Jagex's rules in both games, and an account that uses them can be banned. What the rules cover, what is at stake, and what we do and do not promise.

    · 3 min read