Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Geting real mouse position within bot screen


    Kukkeli
     Share

    Recommended Posts

    I would like to make UI that can be used even if mouse movement is disabled. How can I read where actual mouse is within bot screen for the UI? Not the ingame mouse (the one that performs all actions). I would basically like to be able to press things while the bot is running and not mess it up.

    Link to comment
    Share on other sites

    I assume you mean you're using OnPaint and want to be able to perform an action when the paint is clicked on in certain places. If so, you could implement MouseListener in your main script class. You could then use a rectangle to define an area where you want the paint to be interactive.

    private Rectangle aRectangle = new Rectangle(100,100,100,100);
    
        @Override
        public void mousePressed(MouseEvent e) {
           if (aRectangle.contains(e.getPoint())) {
                MethodProvider.log("Mouse pressed within rectangle.");
            }
        }

     

    Link to comment
    Share on other sites

    15 hours ago, Shy said:

    I assume you mean you're using OnPaint and want to be able to perform an action when the paint is clicked on in certain places. If so, you could implement MouseListener in your main script class. You could then use a rectangle to define an area where you want the paint to be interactive.

    private Rectangle aRectangle = new Rectangle(100,100,100,100);
    
        @Override
        public void mousePressed(MouseEvent e) {
           if (aRectangle.contains(e.getPoint())) {
                MethodProvider.log("Mouse pressed within rectangle.");
            }
        }

     

    I tested and I did "kind of" get this to work yaay! And yes exactly like you explained onPaint. I would it to be clicked ONLY by real mouse, not by "ingame mouse" that the bot uses (unless mouseinput is enabled). 

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.