takelley1 / OSRS-AHKScripts

Color bot scripts for OldSchool Runescape, written entirely in AutoHotkey. No client injection or reflection used.
https://www.oldschool.runescape.com
GNU Lesser General Public License v3.0
35 stars 7 forks source link

OrientClient never finds a match #1

Open BarkerB opened 4 years ago

BarkerB commented 4 years ago

On my testing machine, the OrientClient never seems to match the .png file. I've tried both the native client and RuneLite, non fullscreen mode with brightness at the third tick. Is there another setup step that needs to be done, or is this a known issue?

takelley1 commented 4 years ago

Hi BarkerB,

I haven't run this bot in quite a while, but there definitely seems to be some recent interest in it. I'm going to try getting back into development in the coming weeks and will probably do a full rewrite in Python based on what I've learned from writing an Eve Online bot.

The OrientClient function has always been a little inconsistent. Unfortunately AHK (to my knowledge) requires an exact match when image-searching, meaning if your screen's image is just one pixel off from the reference image, AHK won't find a match. There may be an external library that implements this function however.

If you're motivated to get the bot to work on your setup, you could try taking a screenshot of the prayer icon on your own OSRS client, and cropping it so it has the exact same dimensions and coordinates as the reference image (Orient1.png). Make sure the coordinates are the same as Orient1.png, since the function uses hard-coded values to find the edge of the OSRS client window from the location of Orient1.png on your screen.

BarkerB commented 4 years ago

No worries - I closely looked through your repository and used it for inspiration to write some of my my own scripts which I've really enjoyed. That being said, I've certainly already felt the limitations of AutoHotKey. I would love to see you produce some stuff in Python, even if only to give me some ideas and guidance on how I can write it myself! Thanks for taking the time to respond!

takelley1 commented 4 years ago

My NEOBOT repo was written in Python and contains scripts for automating certain tasks in Eve Online. Even if you're not familiar with the game itself, you may still find some inspiration in the lower-level functions and implementations. Please keep in mind though that I am still very much a beginner in Python.

Python has some really wonderful libraries for image recognition (which makes sense, since it's so popular in Machine Learning). OpenCV, as far as I can tell, is one of the gold standards of computer image processing, and it has wrapper for Python.

The actual library I used in NEOBOT is called PyAutoGUI, which provides both image-matching and keyboard/mouse manipulation. It also allows for specifying image tolerances, meaning an exact pixel-to-pixel match is not required to locate the desired image. This was essentially the number one reason I moved from AHK to Python when writing the bot.

I doubt it will be very difficult at all to port the current OSRS AHK scripts to Python based on the foundation that's been established with NEOBOT. I'll definitely try porting it over when I have some free time.