Comments (9)
There's a few things you'd need to do to connect it to the UI. I'm assuming you've duplicated the file and then renamed the ExampleBot class to something else (which is what you should do).
- In the
./src/model/osrs
folder, find the__init__.py
file and add a reference to your new bot class there (you'll see the existing ExampleBot for reference). Basically, whenever you create a new file in some folder, just add a reference to it in the folder's dedicated init file. - Then in
./src/OSRS Bot COLOR.py
, around line 109 you'll need to create an instance of your bot, assign the controller to it (enabling communication between the bot and the view), and add a button to the button map. There are plenty of examples around this part of the code so it should be as easy as copying and making slight edits. Just above this section is a brief set of instructions for how to do that bit.
While I'm here, I should let you know that the OSRS bot class is not yet properly implemented (working on it). This doesn't need to stop you from making bots right now though - it's certainly doable, but will be a bit more work.
ExampleBot
is very bare-bones. You'll notice it inherits the Bot
class, so it would be worth giving bot.py
a quick read-through to see what functions and properties ExampleBot
has at its disposal. If you want a bot that can make use of RuneLite features, your bot should inherit RuneLiteBot
instead (which also inherits from Bot). So the class declaration could look like this:
class YourNewBot(RuneLiteBot):
etc...
It's worth giving runelite_bot.py
a read-through as well.
What the OSRS folder is missing is a dedicated class for the OSRS game itself; so a class that defines certain OSRS-specific functions (E.g., teleporting, bank actions, etc). It is this class that I would have inheriting the RuneLiteBot class, then little custom bots could just inherit this one. This might sound a little confusing, which is why this project desperately needs a properly written tutorial, but if you want something to go off of, have a look at the ./src/model/osnr
folder - specifically the osnr_bot.py
file. OSNR means "Old School Near Reality" (private server), and it's where I've been doing my testing. This is a single class that defines all the unique aspects of that game's client so that all inheriting bots can make use of it.
Maybe today I'll go ahead and make a proper OSRS class and map out the important bits. I kind of forgot to do that. It would likely look very similar to osnr_bot.py
.
_EDIT: As I look at the RuneLiteBot
class, it has mostly what you need to make decent OSRS bots. So you don't need to have a dedicated OSRSBot class, certainly not as crucial as I thought it was when I originally wrote this. For private servers, I'd say it's more important because they tend to be very custom and exploitable (E.g., bank presets, custom teleport menus, etc.), and it's wiser to write functions that do those things once rather than recreate the wheel every time in individual bot scripts. OSRS is less friendly, so it's harder to write these helper functions - for instance, we can't make a simple teleport(to: str)
function for OSRS because each teleport is unique, requiring certain rune combos, certain mouse positions, and sometimes certain items, etc. However, this class should be created eventually with a designated setup()
function that configures the client for you every time you press play, so I'll get around to that eventually.
from os-bot-color.
Very bizarre issue. You can solve it by downgrading OpenCV by running:
pip install opencv-python==4.5.4.60
Not sure why the requirement.txt was built with a version of OpenCV that I am not using...
from os-bot-color.
Worked great!
from os-bot-color.
Perfect. If you have any questions, let me know. Wiki tutorials are in the works and should be completed this week, followed by video tutorials.
from os-bot-color.
One more quick question. When I duplicate example_bot.py and try to make another, it doesn't appear in the UI. I've changed the description and title.
from os-bot-color.
Awesome, thanks for the details! I'll give it a try when I get home today.
from os-bot-color.
Hey If it's okay I'd like to post some feature requests and then try to implement them. If I go that route, are you open to open-source collaboration? I'd really like to contribute to this project, it's really cool!
from os-bot-color.
Absolutely! I'm still pretty new to open-source work so if there's anything I need to do before you can get started just let me know :)
I've also updated the wiki a bit, which might help you make sense of things https://github.com/kelltom/OSRS-Bot-COLOR/wiki/Design
from os-bot-color.
Awesome! I'll start off with something small to make sure I can follow your flow best!
from os-bot-color.
Related Issues (20)
- [OSR-18] Add remote mouse option HOT 1
- [OSR-17] Add Window attribute for entire RuneLite window to allow right-clicking inventory items HOT 4
- [OSR-15] OCR fails when lines of text are too close together HOT 2
- [OSR-27] Add function to determine if color exists in Rectangle
- [OSR-28] Add "latest msg" features to Morg API utility HOT 1
- [OSR-29] Add Rectangle manipulation functions HOT 2
- [OSR-35] ValueError when using red_click_check in mouse.click HOT 3
- [OSR-38] Bot.stop() function does not work when called within script
- [OSR-39] Add "inventory full" check to Morg API
- [OSR-40] Improve Geometry constructors & sorting key functions
- [OSR-44] Make SpriteScraper use OSRS Wiki API
- [OSR-45] Profile Manager plugin interferes with game_launcher utility HOT 2
- [OSR-47] Swap PyAutoGUI for PyDirectInput HOT 3
- [OSR-48] Implement context manager for StatusSocket
- ERROR: unsupported argument text_font to the CTkLabel constructor from the customtkinter package.
- Stuck on this error, thank you in advance for any help HOT 2
- runelite_cv.py -> extract_objects() deduplication
- Jagex Launcher support HOT 3
- Some questions about the project HOT 2
- Old Discord Member - Request New Invite HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from os-bot-color.