colby__ Posted August 29, 2016 Author Share Posted August 29, 2016 (edited) MouseClicked is all you need really AFAIK. It will fire the event directly yes. EDIT: scratch that, I believe the proper procedure is: MousePressed MouseReleased MouseClicked In that order botInput indicates whether this mouse event was generated by the bot, or by the user popuptrigger indicates whether or not this event triggers a popup (it does not) time is the timestamp for which this event occured (now) From AWT MouseEvent: What would be a popup trigger? When would it be true? Also do you know which component I should pass? Edited August 29, 2016 by colby__ Quote Link to comment Share on other sites More sharing options...
colby__ Posted August 29, 2016 Author Share Posted August 29, 2016 (edited) Here is the code I have so far: public void click(int x, int y, int xT, int yT, boolean button) { x = mX = dev(x, xT); y = mY = dev(y, yT); int b0 = button ? MouseEvent.BUTTON1 : MouseEvent.BUTTON2; long t0 = System.currentTimeMillis(), t1 = t0; t0 -= dev(1, 80F); Component c = bot.getCanvas(); MouseEvent evt = new MouseEvent(c, MouseEvent.MOUSE_MOVED, t0, 0, x, y, 1, false, b0); bot.getMouseEventHandler().mouseMoved(evt); evt = new MouseEvent(c, MouseEvent.MOUSE_PRESSED, t0, 0, x, y, 1, false, b0); bot.getMouseEventHandler().mousePressed(evt); evt = new MouseEvent(c, MouseEvent.MOUSE_RELEASED, t1, 0, x, y, 1, false, b0); bot.getMouseEventHandler().mouseReleased(evt); evt = new MouseEvent(c, MouseEvent.MOUSE_CLICKED, t1, 0, x, y, 1, false, b0); bot.getMouseEventHandler().mouseClicked(evt); } I am painting mX and mY and it's definitely on the game screen yet it is not registering as a click, not walking or even showing hover options when the mouse event is fired over an object. Any ideas?EDIT: The code DOES work but only when human input is ENABLED in the gui. Upon disabling human input, the code no longer clicks. How can I bypass this? Edited August 29, 2016 by colby__ Quote Link to comment Share on other sites More sharing options...
FrostBug Posted September 1, 2016 Share Posted September 1, 2016 Here is the code I have so far: public void click(int x, int y, int xT, int yT, boolean button) { x = mX = dev(x, xT); y = mY = dev(y, yT); int b0 = button ? MouseEvent.BUTTON1 : MouseEvent.BUTTON2; long t0 = System.currentTimeMillis(), t1 = t0; t0 -= dev(1, 80F); Component c = bot.getCanvas(); MouseEvent evt = new MouseEvent(c, MouseEvent.MOUSE_MOVED, t0, 0, x, y, 1, false, b0); bot.getMouseEventHandler().mouseMoved(evt); evt = new MouseEvent(c, MouseEvent.MOUSE_PRESSED, t0, 0, x, y, 1, false, b0); bot.getMouseEventHandler().mousePressed(evt); evt = new MouseEvent(c, MouseEvent.MOUSE_RELEASED, t1, 0, x, y, 1, false, b0); bot.getMouseEventHandler().mouseReleased(evt); evt = new MouseEvent(c, MouseEvent.MOUSE_CLICKED, t1, 0, x, y, 1, false, b0); bot.getMouseEventHandler().mouseClicked(evt); } I am painting mX and mY and it's definitely on the game screen yet it is not registering as a click, not walking or even showing hover options when the mouse event is fired over an object. Any ideas? EDIT: The code DOES work but only when human input is ENABLED in the gui. Upon disabling human input, the code no longer clicks. How can I bypass this? Incase any1 else wonder; It can be 'fixed' by setting botInput to true Quote Link to comment Share on other sites More sharing options...
GaetanoH Posted September 1, 2016 Share Posted September 1, 2016 Anyone has an idea why he got banned? Quote Link to comment Share on other sites More sharing options...
Acerd Posted September 1, 2016 Share Posted September 1, 2016 Anyone has an idea why he got banned? probably vader 1 Quote Link to comment Share on other sites More sharing options...
GaetanoH Posted September 1, 2016 Share Posted September 1, 2016 probably vader Vader? Quote Link to comment Share on other sites More sharing options...