Kukkeli 5 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.
Shy 14 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."); } }
Kukkeli 5 Author 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).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.