dayong143333333 Posted June 1, 2020 Share Posted June 1, 2020 (edited) Mouse press and release?do it! Similar to the keyboard :pressKey(int keyCode) releaseKey(int keyCode) Desired effect: mouse.press; sleep(100); mouse.release; help!!!! Edited June 1, 2020 by dayong143333333 Quote Link to comment Share on other sites More sharing options...
Chris Posted June 1, 2020 Share Posted June 1, 2020 (edited) https://osbot.org/api/org/osbot/rs07/input/mouse/ClientMouseEventHandler.html#generateBotMouseEvent-int-long-int-int-int-int-boolean-int-boolean- Edited June 1, 2020 by Chris Quote Link to comment Share on other sites More sharing options...
dayong143333333 Posted June 1, 2020 Author Share Posted June 1, 2020 13 minutes ago, Chris said: https://osbot.org/api/org/osbot/rs07/input/mouse/ClientMouseEventHandler.html#generateBotMouseEvent-int-long-int-int-int-int-boolean-int-boolean- thanks ! but I'm a little dizzy public void generateBotMouseEvent(int id, // detailed explanation long time, // detailed explanation int modifiers, // detailed explanation int x, // detailed explanation int y, // detailed explanation int clickCount, // detailed explanation boolean popupTrigger, //detailed explanation int button, //detailed explanation boolean botInput) //detailed explanation Please explain I am a rookie Quote Link to comment Share on other sites More sharing options...
Nbacon Posted June 1, 2020 Share Posted June 1, 2020 Examples Quote private void pressMouse() { getBot().getMouseEventHandler().generateBotMouseEvent(MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), 0, getMouse().getPosition().x, getMouse().getPosition().y, 1, false, MouseEvent.BUTTON1, true); } private void releaseMouse() { getBot().getMouseEventHandler().generateBotMouseEvent(MouseEvent.MOUSE_RELEASED, System.currentTimeMillis(), 0, getMouse().getPosition().x, getMouse().getPosition().y, 1, false, MouseEvent.BUTTON1, true); } public void generateBotMouseEvent(int id, // MouseEvent.MOUSE_PRESSED or MouseEvent.MOUSE_RELEASED I think there maped to 1 and 0 long time, // The system time of when you want this click to happen. int modifiers, // Set this to 0. int x, //the x on a cartisian plane (0,0) is top left int y, // the y on a cartisian plane int clickCount, // 1 is click once 2 is double ... boolean popupTrigger, //just make this false int button, //MouseEvent.BUTTON1 , MouseEvent.BUTTON2 right/left boolean botInput) //make this true This a tip for all new to coding and want to see exaples of obscure code with bad docs.(I have said it like 30 times) goto github.com login type the string of the package you are using your case "org.osbot.rs07.input.mouse.MouseDestination;" put osbot after click Code its under Repositories (https://github.com/search?q=org.osbot.rs07.input.mouse.MouseDestination&type=Code) Look at the code and try to make it work. If you cant find anything try searching other keywords or using something else or rethink logic Quote Link to comment Share on other sites More sharing options...
dayong143333333 Posted June 1, 2020 Author Share Posted June 1, 2020 1 hour ago, Nbacon said: Examples public void generateBotMouseEvent(int id, // MouseEvent.MOUSE_PRESSED or MouseEvent.MOUSE_RELEASED I think there maped to 1 and 0 long time, // The system time of when you want this click to happen. int modifiers, // Set this to 0. int x, //the x on a cartisian plane (0,0) is top left int y, // the y on a cartisian plane int clickCount, // 1 is click once 2 is double ... boolean popupTrigger, //just make this false int button, //MouseEvent.BUTTON1 , MouseEvent.BUTTON2 right/left boolean botInput) //make this true This a tip for all new to coding and want to see exaples of obscure code with bad docs.(I have said it like 30 times) goto github.com login type the string of the package you are using your case "org.osbot.rs07.input.mouse.MouseDestination;" put osbot after click Code its under Repositories (https://github.com/search?q=org.osbot.rs07.input.mouse.MouseDestination&type=Code) Look at the code and try to make it work. If you cant find anything try searching other keywords or using something else or rethink logic thanks thanks thanks thanks Quote Link to comment Share on other sites More sharing options...