Logo

How to Build A Fully Automated Bot Farm

How to build a fully automated OSRS bot farm using the RSPeer API.

Are you interested in creating a bot farm but want to automate it as much as possible?

Such as, automatically setting up VPS’s with the latest RSPeer jar, purchasing scripts, purchasing instances, etc. If so, this is the guide for you.


Registering an API Client

To get started using the RSPeer API programmatically, we must register an API client.

Head down to https://app.rspeer.org/#/user/apiClients to create your first API client and retrieve your key.

https://i.imgur.com/s5GcYFL.png


Authorizing Your Requests

Now that you have your API key, you need to authorize our requests to the RSPeer API.

To do this, add an HTTP header called ApiClient and set the value to your key.

https://i.imgur.com/NxR7XaV.png

This example here is using https://www.getpostman.com/ to test out the HTTP requests.


Downloading The Latest RSPeer Version

You can automatically download the latest RSPeer version by sending a GET request to

https://services.rspeer.org/api/bot/currentJar

You may check the current version of the latest RSPeer by sending a GET request to https://services.rspeer.org/api/bot/currentVersion

It is recommended to store locally the version of the current jar you have and then checking that version against the current live version to verify if you are on latest. An easy way to do this would be to save the result from https://services.rspeer.org/api/bot/currentVersion to a file on your local computer when you download the client.


Automatically Logging Into The Client

If you are programmatically setting up a new computer and have not logged in yet, RSPeer will require you to login so it can authenticate who you are.

Fortunately, you can do this automatically with the steps below:

  1. Locate the RSPeer cache folder. On Windows, this is located in My Documents/RSPeer/cache. On Mac OS X and Linux, this is located in Home/RSPeer/cache.
  2. Create an empty file called rspeer_me in your RSPeer cache folder.
    1. Make sure the file has no extension and the full file name is rspeer_me.
  3. Write your api client key to this file. You can retrieve your api client key by visiting: https://app.rspeer.org/#/user/apiClients

    1. Make sure you did not include a line break or any extra spaces, it will not work if you did. The file must only contain the key and nothing else. You can verify if there is a line break by opening the file in your favorite text editor and seeing if there are any new lines.
  4. Once you have written to that file, start up the client. The client should encrypt your key and save it to a file called misc_new.


Automating The Bot Management Panel

You can utilize the infastructure of the bot management panel to automatically launch clients on remote computers.

The bot management panel is located here: https://app.rspeer.org/#/bot/management, but it uses an API to launch your accounts, which we can utilize.

  1. Get a list of connection launchers by sending a GET request to: https://services.rspeer.org/api/botLauncher/connected

This should return a response that looks similiar to:

https://i.imgur.com/A2UTYU5.png

If you do not have any connected launchers, please follow the bot management panel guide: https://rspeer.org/docs/bot-management/

The JSON key, DSCrI6tn_V6Wvy40AAAB is the important part here, this is the socket address of where we will send our commands to start a client. This will be different for each launcher you have connected.

  1. Send a POST request to https://services.rspeer.org/api/botLauncher/send with the following payload to start a client normally with no proxy, no script, and normal arguments. https://api.myjson.com/bins/ejldv
  2. You should see your client starting up on the launcher you specified.
  3. If you would like to use a pre-existing quick launch or proxy, you can modify the payload to include the proxy, like this: https://api.myjson.com/bins/16l3z7
  4. All of these requests can be seen by opening the Chrome Dev Tools and viewing the network requests when starting a client on the bot management panel. You can copy these requests and replace the session with your api client key.

  5. Copying these requests will allow you to automate every task of using the bot management panel, such as adding/removing quick launch configuration, adding/removing proxies, viewing running clients, and starting clients.


Getting A List Of Running Clients

You can get a list of all running clients by sending a GET request to https://services.rspeer.org/api/botLauncher/connectedClients. This will include any running client, even if you did not launch them from the bot management panel.


Automatically Purchasing Instances

You can automatically purchase instances if yours are about to expire, providing that you have the valid token amount.

All that is required is that you send a POST request to https://services.rspeer.org/api/store/purchase with the following payload:

{"sku":"instances","quantity":5}

Replace 5 with whichever quantity you desire.


Getting A List Of Orders

You can get a list of orders to know whether your client instances or script instances are about to run out.

To get this list, send a GET request to https://services.rspeer.org/api/order/list and it will return an array of all your orders.

Each order object will look like this:

https://i.imgur.com/SSFk733.png

You can calculate the expiration of your order by taking expirationInMinutes on the item object and adding it to the timestamp. The default for almost every item is 30 days, but we recommend you calculate it using expirationInMinutes.


Getting A List Of Script Orders

You can get a list of orders to know whether your client instances or script instances are about to run out.

To get this list, send a POST request to https://services.rspeer.org/api/script/listAccess with the following payload:

{"includeScript":true,"nonExpired":false}

Change nonExpired to true if you only want to see non expired orders.

You can use the timestamp field + 30 days to calculate the expiration date of your script purchase.


Helpful Routes

Here is a list of helpful routes that you can use.

RouteMethodDescriptionInfo
https://services.rspeer.org/api/script/listPOSTGets your current list of scripts.{“type”:“mine”,“search”:“”,“orderBy”:“featured”,“category”:null}
https://services.rspeer.org/api/user/balanceChangesGETBalance Changes
https://services.rspeer.org/api/botLauncher/logs?id=DSCrI6tn_V6Wvy40AA8l&top=100&skip=0&type=messageGETRetrieves all client logs from clients on that remote pc.Replace id in the query string with the launcher id retrieved from the get launchers call.