CarsonT Posted July 18, 2014 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.
Dashboard Posted July 18, 2014 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
CarsonT Posted July 19, 2014 Author 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.
Dashboard Posted July 19, 2014 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.
CarsonT Posted July 19, 2014 Author 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?
CarsonT Posted July 19, 2014 Author Posted July 19, 2014 Dashboard claims to have added this to a future update.