How to Make a Runescape Bot Script in Python?

 Make a Runescape Bot Script in Python

This is a simple python bot scripting tutorial for Runescape. Most people will not call it a Bot, but simply an autoclicker. It doesn’t matter if you don’t know how to code in Python. This tutorial is beginners friendly. Because the python script is simple. With just less than 10 lines of python codes you can automate some tasks in Runescape. But, don’t expect too much from this method.

Runescape has many skills that don’t require you to move around too much. This simple python bot for Runescape will work better on skills like cooking, smithing, thieving, fletching, mining and other AFK skills. Of course, you can make this script as complex as you want. But keep it simple for now, so you don’t make too many mistakes.

It is very easy to make mistakes when you first start. This simple python bot for Runescape will get you banned. Only experience can help you with this. With experience you will know what skills you can bot and what skills will get you banned. The fact that a skill is very AFK doesn’t mean you should automate it. This is why I will advise you to not try this method on your main account.

Before you start making your own runescape bot with python. I will suggest you use a new account that you don’t need. Also, use a VPN to avoid chain ban from Runescape. This method will work well on Old School Runescape and Runescape 3. However, Runescape 3 is so AFK. I will advise you to start from here.

This script is not for bot farmers. It works better with just one account. Maybe some people might bot on two accounts. More than that is not going to work very well. This simple Runescape Bot Script will help players who don’t have too much time to grind. Players who want to make some money for a bond. And anybody who wants to upgrade their gears or max in some AFK skills.

Most Players in the Runescape Community are against botting and macroing. You can find a lot of videos about that on Youtube. Also, Jadex will ban you if you are botting. I am not going to suggest to you what AFK skills you should avoid botting. The best way to avoid getting banned is simple, don’t bot. It is very easy to get yourself in trouble with these scripts. You don’t have to run this script for over two hours to get banned. If your script clicks 1,000 times on the same spot in less than 1 minute. You can get banned just for that. 

Don’t forget to use a VPN and a few suicide accounts. In my experience new “botters” will make mistakes  and get caught. Do your own research on Google to find the best and the worst spot to bot. You should be able to find some examples of python bots for Runescape on Github. Don’t run these scripts, use them only to learn what other modules and methods cheaters like you are using to ruin the game for everyone else. 

All you need to start making your own python autoclicker or bot script is obviously any python version that is over 3.5. The pyautogui module for python. This module will click on the screen for you. It can detect images as well. This is the link for pyautogui documentation.

Let’s get started with the script

import pyautogui
x = pyautogui.position()
print(x)

Line 1:

Import the python pyautogui module, so you can use its built in functions.

Line 2:

Create a variable x. You can name this variable whatever you want if you follow python variable naming conventions.

Assign the function pyautogui.position() to x. The pyautogui.position() function will return the coordinates X and Y of the mouse cursor. This function is very useful. Before you click anywhere on the screen, you need to let the script knows where to click. And this function will provide the coordinates x and y. You need to save x and y, so you can use them on another function.

When you run the script, it will output something like:

Point(x=538, y=304)

How to use x and y position provided by pyautogui.position() to click on the screen?

If you want to click to x and y position on the screen, use the function

pyautogui.click(x,y)
import pyautogui
x = 538
y = 304
z = pyautogui.click(x,y) # or z = pyautogui.click(538,304)
print(z)

This short code will move the mouse to x and y location on the screen. And then left click on it.

Time Sleep Function

You need to tell your script to wait before it clicks again somewhere else. To do that you can use the time module in python. Like time.sleep(in second).

import pyautogui, time

pyautogui.click(538,304)
time.sleep(20) #wait 20 seconds before clicking somewhere else
pyautogui.click(1124,824)

As you can see I did not use any variables. I went straight to business.

RANDOM FUNCTION

With the random python module. You can make your script wait between 20 to 25 seconds. The random module will chose a random number between 20 and 25. Every time you run your script, it will generate a different number. To do that you can use random.randint(20,25) in time.sleep() function. Just like this: time.sleep(random.randint(20,25)).

import pyautogui, time, random

pyautogui.click(538,304)
time.sleep(random.randint(20,25))
pyautogui.click(1124,824)

LOOP YOUR PYTHON SCRIPT FOREVER OR HOW LONG YOU WANT

A few examples

The first code example will run the program 12 times

x=0
while x<12:     
    pyautogui.click(1154,442)     
    time.sleep(50)     
    x += 1

The second code example will run forever until you close the program.

while True:
     pyautogui.click(1534,596)
     time.sleep(int(random.randint(4,7)))

That’s all you need to make a simple bot or autoclicker with python. If you want to learn more about pyautogui, click here.

This blog post is not done. I will improve this article and add more examples later.