Git Product home page Git Product logo

Comments (9)

kelltom avatar kelltom commented on May 16, 2024 1

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).

  1. 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.
  2. 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.

e1oiqSCCzN

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.

kelltom avatar kelltom commented on May 16, 2024

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.

Travis-Barton avatar Travis-Barton commented on May 16, 2024

Worked great!

from os-bot-color.

kelltom avatar kelltom commented on May 16, 2024

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.

Travis-Barton avatar Travis-Barton commented on May 16, 2024

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.

Travis-Barton avatar Travis-Barton commented on May 16, 2024

Awesome, thanks for the details! I'll give it a try when I get home today.

from os-bot-color.

Travis-Barton avatar Travis-Barton commented on May 16, 2024

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.

kelltom avatar kelltom commented on May 16, 2024

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.

Travis-Barton avatar Travis-Barton commented on May 16, 2024

Awesome! I'll start off with something small to make sure I can follow your flow best!

from os-bot-color.

Related Issues (20)

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.