CarsonT Posted July 18, 2014 Share Posted July 18, 2014 What would I use to have the player type something and then send it? I've tried to use the Keyboard.getString("");, but that did not work. I've also looked into BotKeyEvent and haven't had any luck. Link to comment Share on other sites More sharing options...
Dashboard Posted July 18, 2014 Share Posted July 18, 2014 (edited) If you're trying to get the user to enter info: String name = JOptionPane.showInputDialog("What's your name?."); If you're trying to type ingame: keyboard.typeString("Hello world!"); Edited July 18, 2014 by Dashboard Link to comment Share on other sites More sharing options...
Joseph Posted July 18, 2014 Share Posted July 18, 2014 What he said above Link to comment Share on other sites More sharing options...
CarsonT Posted July 19, 2014 Author Share Posted July 19, 2014 If you're trying to get the user to enter info: String name = JOptionPane.showInputDialog("What's your name?."); If you're trying to type ingame: keyboard.typeString("Hello world!"); It'd be typing ingame, sorry for the confusion. However, I cannot use just keyboard.typeString("");, because I cannot make a static reference to the non-static method. So I declared Keyboard k = new Keyboard(); and then did k.typeString("Hello World."); Which gives me a nullPointerException. I might just be looking at this the wrong way, thanks for any help. Link to comment Share on other sites More sharing options...
Dashboard Posted July 19, 2014 Share Posted July 19, 2014 It'd be typing ingame, sorry for the confusion. However, I cannot use just keyboard.typeString("");, because I cannot make a static reference to the non-static method. So I declared Keyboard k = new Keyboard(); and then did k.typeString("Hello World."); Which gives me a nullPointerException. I might just be looking at this the wrong way, thanks for any help. You don't need to do it statically. If you need help, pm me your teamviewer id and pass. Link to comment Share on other sites More sharing options...
Eliot Posted July 19, 2014 Share Posted July 19, 2014 script.keyboard.typeString("Hello World!"); Link to comment Share on other sites More sharing options...
CarsonT Posted July 19, 2014 Author Share Posted July 19, 2014 script.keyboard.typeString("Hello World!"); Yeah, I was referencing it as Keyboard.typeString("Hello World!");, thank you all for help. So I don't suppose we have a method - like setSpeed(); with the mouse class - for the typing? Link to comment Share on other sites More sharing options...
Joseph Posted July 19, 2014 Share Posted July 19, 2014 Nope, if only Link to comment Share on other sites More sharing options...
CarsonT Posted July 19, 2014 Author Share Posted July 19, 2014 Dashboard claims to have added this to a future update. Link to comment Share on other sites More sharing options...
Joseph Posted July 20, 2014 Share Posted July 20, 2014 sweet Link to comment Share on other sites More sharing options...
Phoenix21 Posted July 27, 2014 Share Posted July 27, 2014 Thank you for great answer! Link to comment Share on other sites More sharing options...