GithubHelp home page GithubHelp logo

gravec / 0srsbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ssmith21/0srsbot

0.0 0.0 0.0 135.55 MB

Computer Vision pyautogui bot which plays the online MMORPG Runescape 2007

Python 100.00%

0srsbot's Introduction

OpenCV Old School Runescape Bot!

Disclaimer:

Use of bots is against the OSRS rules. This bot is purely a coding exercise and I have therefore removed and obscurified important parts of the code to prevent people from quickly downloading and using the bot to gain an in-game advantage.

About the game

OSRS is an online MMORPG played on mouse and keyboard. Part of playing the game is training various skills in order to level up. There are many ways to train each skill and levelling up each skill leads to the player's account gaining access to more content of the game. To find out more or to play the game, visit https://oldschool.runescape.com/ .

About the bot

This bot uses an open source computer vision software "OpenCV" to detect objects on the screen and train specific skills. A python class is used to continuously capture screenshots, which are passed to the OpenCV API to detect certain objects on screen. We can call this process the "Vision" process.

Here's an example of detecting rocks used to train the mining skill

Object detection without filtering In order to reduce visual noise and increase the performance of the "Vision", a colour filter can be applied to each screenshot using the HSVFilter class. This improves "Vision" performance by allowing the OpenCV API to more easily detect the on-screen objects since there is less visual noise. Although each screenshot must be processed, if filtered correctly, the framerate can actually increase in addition having more accurate object detection.

In less than 60 seconds, we can filter out all objects except my character

Drowning out noise using HSV filter Once we've filtered out what we need on screen, we need the bot to actually interact with the game. We can call this process the "Movement" process. The "Movement" must also mimic human movement, otherwise the game's bot-detection system could mark the account as a bot. Since it is unkown to players how the bot-detection system works, it is up to the programmer to make assumptions as to what will trigger the anit-botting system. So how does the bot play the game? The "Vision" process returns a list of points to click on displayed as crosshairs. These points are the pixel coordinates on the monitor which display the in game objects to detect. The "Vision" and "Movement" process run in parallel using multiprocessing, therefor this bot requires the atleast 2 cores. A custom object is used to implement Points which are passed to a shared Array which both processes interact with. This bot is also scalable to different skills, so as long as there's a pattern in training the skill, this bot should work!

Here are some action shots of the bot training 3 different skills

On the left is the computer vision feed, on the right is what the user sees; the user is not interacting with the computer at all. Aerial fishing Mining Woodcutting

Future plans.

GUI to start the bot, a wizard to help setup the movement speed, machine learning image detection, performance improvements.

0srsbot's People

Contributors

ssmith21 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.