osrs_basic_botting_functions icon indicating copy to clipboard operation
osrs_basic_botting_functions copied to clipboard

Functions for automating osrs botting using Python.

Old School Botting Functions

Full tutorial on creating Functions for automation using Python for osrs botting. The example used will be woodcutting, where the script will use colour detection using opencv and use pyautogui to move the mouse, click and use the keyboard to drop items using an image recognition module that will detect the wood icons in the inventory.

Other python files will also use tesseract-OCR to detect text within images using tesseract-OCR image to text recognition functions.

Setup

Note: PC Monitor settings - change resolution to 1920x1080 panel and text of apps was set to 100%.

Right click and select Display Settings

image

In the Scale And Layout section - Change size of text to 100% and Set Display Resolution to 1920 x 1080 for best results.

image

Installing Pycharm

pycharm

pycharm windows

How to Install Pycharm

How to add Project with Pycharm

Editing how to ensure venv (virtual environment) is active

core.py and function.py

For the full video tutorial click link: https://www.youtube.com/watch?v=C7ZY4KYpFII

This video is more about how it was created at the start core.py is how to make the python script focus on the old school runescape application and adjust the window size so all the scripts run as intended. Then functions.py is where all the different kinds of shortcut functions are placed to reference the mini map, or a piece of code to do color detection or open the inventory.

Quick module install Steps

in terminal type:

pip install -r requirements.txt

tesseract-ocr = https://sourceforge.net/projects/tesseract-ocr-alt/files/tesseract-ocr-setup-3.02.02.exe/download

Tutorial on installing tesseract-OCR: https://youtube.com/watch?v=X3snnwzJfEw&t=25m15s

Runelite Setup

Tutorial on runelite setup click link: https://youtube.com/watch?v=JO2FvkJwppA

pybot-config.yaml (configuration file)

image

client_title: Is the title of the application window usually Runelite if you have completed the steps for the Runelite Setup, if not then enter RuneLite - username or OpenOSRS

image

image

enable_on_start: if you don't want the config window to pop up each time, enter as false

file_path_to_client: the head folder where the OSRS client is stored usually .runelite or .openosrs

pc_profile: is the user profile of the pc so it can find runelite or openosrs

image

tesseract_path: Is the folder address to tesseract-ocr program

image

- Note: copy the format below make sure to include the slashes (\).

image

Woodcutting

features

Cuts woods and makes fire

  • Use object marker plugin to highlight trees red, green or yellow.

  • Make sure to have an axe equipped and a tinderbox if firemaking.

  • Turn on woodcutting plugin

  • Turn off Show weight in item stats Tutorial on firemaking code click link: https://youtu.be/bHZCQUChG_k

image

  • Pick a object marker color, a wood type and how long in hours to run for

image

fishing.py

  • Turn on fishing plugin.
  • Make sure to have net for prawn fishing or a rod and bait/feathers for fish. Tutorial on fishing code click link: https://youtube.com/watch?v=5K-nMy9Pdvg

mining.py

  • Turn on mining plugin.
  • Mark ore spots using the object marker to green.

image

  • Make sure to equip a pick axe.

  • enter the ore type, the marker color and how long to run in hours (Change Run_Duration_hours) image

image

Tutorial on mining code click link: https://youtube.com/watch?v=dkD5gXcgQYI

combat.py

  • Turn on NPC Indicators plugin and Opponent Information plugin
  • Change Highlight colour to #ff00ffff

image

  • Hold Shift and Right Click on NPC/Mob and select Tag-All

image

  • In the Combat script change the first value to the NPC/Mob name
  • Change Run_duraction_hours to the number of hours to run script for

image

  • To add or use a NPC/Mob not on the list add it to the monster_array as ['each iteration captured by the combat_text'] and add to monster_list the name

image

Tutorial on combat code click link: https://youtube.com/watch?v=llGbhVfU1Bc

thieving.py

steal_man() Works with Knights, Goblins and Thieves etc.

  • Turn on NPC Indicators plugin
  • Change Highlight colour to #ff00ffff
  • Hold Shift and Right Click on NPC/Mob and select Tag <Man><Knigt> etc.

image

  • Make sure pickpocket will be actioned on left click (some npcs even on always right click have 'talk to' as left click option)

image

  • To stop script hold down the capslock key

Improvements to add

  • Stop or eat when health is low (warning this does not stop when health is low)

steal_tea()

  • Hold shift and mark object Tea Stall (Make sure the color is red)

image

image

smithing.py

Tutorial on smithing code click link: https://youtube.com/watch?v=YezEeVjoP6o

magic.py

features

High alching

Superheat item

Tutorial on magic code click link: https://youtube.com/watch?v=Vyhy2CpfK7I

osrs_walker.py

Tutorial: TBA

  • Located in jar_files: Add httpplug-1.0.3.jar to C:\Users\ .openosrs \plugins

  • Located in jar_files: Add shortestagility-5.0.2.jar to C:\Users\ .openosrs \plugins

    image

Setup

  • Create txt file on desktop paths.txt, the modified plugin shortestagility-5.0.2.jar saves the coordinates when a path target is made in osrs.

  • image

  • image

  • image

  • Use main map and right click then select 'set target', run server.py and then run osrs_walker.py.

  • ezgif com-gif-maker (1)

Troubleshooting

python venv/Scripts/pywin32_postinstall.py -install

Wiki

Wiki page on function descriptions and purpose

Consider donating if you found the project fun and learnt more about python.

image