Kukkeli 0 Share Posted March 25, 2020 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 More sharing options...
Shy 14 Share Posted March 26, 2020 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 More sharing options...
Kukkeli 0 Author Share Posted March 26, 2020 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now