Sicilian7 9 Share Posted September 6, 2020 I'm trying to enter Keyboard input as shortcuts for things such as "Make" when fletching, crafting etc. IF I want to press the space bar, then normally Keyboard.type(" ") works fine. However, sometimes whenever there is lag, the bot will accidentally type a space into chat and press enter. I obviously don't want the bot to sometimes accidentally type into chat by pressing enter. Is there any way to enter keyboard input without also pressing Enter? Link to comment Share on other sites More sharing options...
Pandemic 2675 Share Posted September 6, 2020 You can use Keyboard.type(" ", false) Link to comment Share on other sites More sharing options...
xVril 21 Share Posted September 11, 2020 From the JavaDocs type public void type(java.lang.Object message) Types a message and presses enter Parameters: message - message to type type public void type(java.lang.Object message, boolean enter) Types a message and presses enter depending on parameters Parameters: message - message to type enter - true to press enter at the end type public void type(java.lang.Object message, boolean enter, boolean makeMistakes) Types a message and presses enter depending on parameters Parameters: message - message to type enter - true to press enter at the end Link to comment Share on other sites More sharing options...
LordJashin32 54 Share Posted September 14, 2020 On 9/6/2020 at 5:20 PM, Sicilian7 said: I'm trying to enter Keyboard input as shortcuts for things such as "Make" when fletching, crafting etc. IF I want to press the space bar, then normally Keyboard.type(" ") works fine. However, sometimes whenever there is lag, the bot will accidentally type a space into chat and press enter. I obviously don't want the bot to sometimes accidentally type into chat by pressing enter. Is there any way to enter keyboard input without also pressing Enter? You can also send the KeyEvent you want directly to the canvas like so: Client.getInstance().setKeyboardInputEnabled(true); //KeyEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar) Instance.dispatchCanvasEvent(new KeyEvent(Instance.getCanvas(), KeyEvent.KEY_TYPED, System.currentTimeMillis(), 0, KeyEvent.VK_SPACE, KeyEvent.CHAR_UNDEFINED)); Client.getInstance().setKeyboardInputEnabled(false); Also isn't there some dialogue options for that? Well anyway. Cheers. @Pandemic his post is better than mine for this because u can just do false. Make sure you account for lag and check to see if the thing ur pressing space for is actually there. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.