Skip to content

ThatOneGuyScripts/BetterColorDetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

BetterColorDetection

This is my color detection and CV files for Kelltoms OSBC.

Download files and merge them with your OSRS-Bot-COLOR-main or unpack them manually.

This is a two part project part one in the screenshot bot. Make sure to initialize the bot in your OSRS init.py

from.ScreenShotBot.ScreenShotBot import ScreenShotBot

Once you launch OSBC navigate to the osrs section and launch BCD Tools helper with runelite open (this can be used with other games as long as they have gameviews set up)

There are no options for the bot just press save.

image

Now everytime you press play the bot will take a screenshot of the 3 main screen spaces we call to in bots. self.win._gameview, self.win.minimap, and self.win.control panel. The bot will automatically stop once the screen shots are made, This should only take less than a second.

image

Now you can navigate back to "select a game" via the drop down menue. You should see a button called BCD 2.0.

image

Once you press it the BCD2 Tools screen will open.

image

Here you can select a one of the Bot views to open. These are the screen shot images ScreenShotBot previously made. (there is a glitch with the checkboxes currently every time you press one it will load an image independent of being checked on or off)

lets select game view.

image

this loads the bot views of the self.win.game_view. The upper picture is your screenshot and the lower picture is changed by the sliders. These dertermine your sliders determine your color profile threshholds. By moving the sliders you can determine your perfect hsv upper and lower values for the color you are trying to find. In the following picture I target the GE tellers purple shirt.

image

Underneath the color sliders you have a text box. Here is where you want to name the color you want to save. Here I'm naming it GeTellerPurple. Below the text entry box is a button called save color profile. When you press this button the color name and hsv values will automatically be saved into BCD's color library. ( DO NOT USE SPACES IN YOUR NAME! If you must use spaces use underscores such as GE_Teller_purple.

image

Next is how you call this function from your bots. This function is called by using self.findcolor(gameview,"color") for example see below. The first line is using OSBC orignal call. The second line is using BCD.

#orignal code 
banks = self.get_all_tagged_in_rect(self.win.game_view, clr.OFF_ORANGE)

#code updated to work with BCD
banks = self.find_color(self.win.game_view, "orange")

This does not replace any functions in OSBC and leaves the orignal calls and color detection system in place. Heres an example of it in action.

Original screenshot taken by OSBC

image

Original screenshot processed with default color detection using updated RGB values to match the HSV values BCD uses.

image

Orginal screenshot processed with BCD

image

Performance

image

About

This is my color detection and CV files for Kelltoms OSBC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages