Sana Posted May 8, 2019 Posted May 8, 2019 (edited) I have this snippet of code that will move the mouse offscreen. It works fine. See the code below: private void antiBanMoveMouseOffscreen() { int myMouseOffscreenAverage = random(learningData.MOUSE_OFFSCREEN_START, learningData.MOUSE_OFFSCREEN_END); paint.state("[Anti-Ban] Moving mouse offscreen for " + myMouseOffscreenAverage + "ms to simulate AFK..."); getMouse().moveOutsideScreen(); Sleep.sleepUntil(() -> false, myMouseOffscreenAverage); paint.state("[Anti-Ban] Complete!"); } I want to unfocus the OSBuddy client after I do this. I see a method to check if the client is focused: getClient().hasFocus() But I don't see an equivalent "getClient().setFocus()". Anyone know how to do this in OSBot? Thanks! Edited May 8, 2019 by Lansana Camara 1
liverare Posted May 8, 2019 Posted May 8, 2019 There's an array of frames in the JFrame class: JFrame.getFrames()[0].setFocus(false) 1
adelmas Posted February 18, 2022 Posted February 18, 2022 (edited) Does anyone else know how to do this? I tried what liverare suggested and it didn't work at all. It brought up a widget debugging window. edit: nvm, figured it out Edited February 18, 2022 by adelmas