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 8689 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)); } Link to comment Share on other sites More sharing options...
ozeki6 32 Author Share Posted November 12, 2018 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? Link to comment Share on other sites More sharing options...
Hashtag 8689 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. Link to comment Share on other sites More sharing options...
Dampoe 3 Share Posted November 14, 2018 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.