ozeki6 32 Share Posted November 12, 2018 Is it possible to hold mouse3 using dreambot's API ? Link to comment Share on other sites More sharing options...
Hashtag 8275 Share Posted November 12, 2018 Seems like api has no methods for such thing. Consider looking into my reply I wrote to this post a while back. You'd need to change the key events to mouse events, obviously. Also, you might need to enable mouse input for the client before using this. Edit: I noticed the thread is archived, so you might not have access to it. However, here's my reply to it. The thread was about sending immediate messages in OSRS chat. private void instantType(final String message) { Canvas canvas = getClient().getInstance().getCanvas(); for (char c : message.toCharArray()) { canvas.dispatchEvent(new KeyEvent(canvas, KeyEvent.KEY_TYPED, System.currentTimeMillis(), 0, KeyEvent.VK_UNDEFINED, c)); } canvas.dispatchEvent(new KeyEvent(canvas, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, KeyEvent.VK_ENTER, KeyEvent.CHAR_UNDEFINED)); canvas.dispatchEvent(new KeyEvent(canvas, KeyEvent.KEY_RELEASED, System.currentTimeMillis(), 0, KeyEvent.VK_ENTER, KeyEvent.CHAR_UNDEFINED)); } falloutr and ozeki6 1 1 Link to comment Share on other sites More sharing options...
ozeki6 32 Author Share Posted November 12, 2018 (edited) 3 hours ago, Hashtag said: Seems like api has no methods for such thing. Consider looking into my reply I wrote to this post a while back. You'd need to change the key events to mouse events, obviously. Also, you might need to enable mouse input for the client before using this. Edit: I noticed the thread is archived, so you might not have access to it. However, here's my reply to it. The thread was about sending immediate messages in OSRS chat. private void instantType(final String message) { Canvas canvas = getClient().getInstance().getCanvas(); for (char c : message.toCharArray()) { canvas.dispatchEvent(new KeyEvent(canvas, KeyEvent.KEY_TYPED, System.currentTimeMillis(), 0, KeyEvent.VK_UNDEFINED, c)); } canvas.dispatchEvent(new KeyEvent(canvas, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, KeyEvent.VK_ENTER, KeyEvent.CHAR_UNDEFINED)); canvas.dispatchEvent(new KeyEvent(canvas, KeyEvent.KEY_RELEASED, System.currentTimeMillis(), 0, KeyEvent.VK_ENTER, KeyEvent.CHAR_UNDEFINED)); } Thanks for answering. I did and it worked however it only works if I have my mouse input enabled in the client. Is there a way to do this without having the mouse input enabled? Edited November 12, 2018 by ozeki6 Link to comment Share on other sites More sharing options...
Hashtag 8275 Share Posted November 13, 2018 8 hours ago, ozeki6 said: Thanks for answering. I did and it worked however it only works if I have my mouse input enabled in the client. Is there a way to do this without having the mouse input enabled? Not that I know of, unfortunately. ozeki6 1 Link to comment Share on other sites More sharing options...
Dampoe 3 Share Posted November 14, 2018 (edited) On 11/13/2018 at 12:35 AM, ozeki6 said: Thanks for answering. I did and it worked however it only works if I have my mouse input enabled in the client. Is there a way to do this without having the mouse input enabled? 22 hours ago, Hashtag said: Not that I know of, unfortunately. Should be possible to enable mouse input in your script though. Instance instance = getClient().getInstance(); instance.setMouseInputEnabled(true); And then just change the value to false if you have released the button or done with whatever you wanted to do. Edited November 14, 2018 by Dampoe ozeki6 and TheHitchhiker 2 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