Tonare Posted July 27, 2015 Share Posted July 27, 2015 Hey guys. I have been writing a script and one the the remaining issues is that typing is very slow. I was wondering if there was a way to increase the speed, or better yet make the text instant (like a macro would). Any comments would be appreciated. I am currently using the typeString method. private Keyboard kb; kb = getKeyboard(); kb.typeString(autoTalker.getMessage(), true); Cheers. Quote Link to comment Share on other sites More sharing options...
Soldtodie Posted July 27, 2015 Share Posted July 27, 2015 Use this http://osbot.org/forum/topic/73829-smartkeyboard-better-human-typing/ or write your own with typeKey 1 Quote Link to comment Share on other sites More sharing options...
Bobrocket Posted July 27, 2015 Share Posted July 27, 2015 Use this http://osbot.org/forum/topic/73829-smartkeyboard-better-human-typing/ or write your own with typeKey As I wrote this class, I would recommend it. I do believe, however, that the default OSBot keyboard class is slow itself (which SmartKeyboard uses) - I'll see what I can do about speed later on, however I have other priorities as of late. Quote Link to comment Share on other sites More sharing options...
Tonare Posted July 27, 2015 Author Share Posted July 27, 2015 Thanks for the suggestions guys. I implemented SmartKeyboard but it was still a bit slow for my liking (although very good stuff in there). I ended up using some of the code to come up with my own solution. The text isn't instant but typing can be interrupted and will resume where it left off. Appreciate the help. 1 Quote Link to comment Share on other sites More sharing options...
Bobrocket Posted July 27, 2015 Share Posted July 27, 2015 Thanks for the suggestions guys. I implemented SmartKeyboard but it was still a bit slow for my liking (although very good stuff in there). I ended up using some of the code to come up with my own solution. The text isn't instant but typing can be interrupted and will resume where it left off. Appreciate the help. If you post your additions in the SmartKeyboard thread I'd be glad to go through and implement them Quote Link to comment Share on other sites More sharing options...
Tonare Posted July 28, 2015 Author Share Posted July 28, 2015 I don't think SmartKeyboard would benefit much from what I have done.. I'll just post my class here in case you wanted to scrounge anything (or if anyone has the same problem I did). You'll see I stole your pressEnter method The point of AutoTalker is to spam a message, but I also needed to accept trade offers. Originally the script had to wait until it had finished typing before accepting the trade - which was a problem because it sometimes took >5 seconds to respond to people and they would lose interest. I used no loops so you can effectively type and do other tasks at the same time (such as trading other players in my case). And even if you go into a state where you aren't typing anything (trading screen), you can resume exactly where you left off. import java.util.ArrayList; import org.osbot.rs07.api.Keyboard; public class AutoTalker { private ArrayList<Character> messageArrayList; private char[] messageArray; public int messageIndex; private Keyboard keyboard; public AutoTalker(Keyboard kb) { messageIndex = 0; keyboard = kb; } public void talk() { if (keyboard.typeKey(messageArrayList.get(messageIndex))) { if (messageIndex == messageArrayList.size() -1) { pressEnter(); } messageIndex = (messageIndex + 1) % messageArrayList.size(); } } public void setMessage(String newMessage) { messageArrayList = new ArrayList<Character>(); messageArray = newMessage.toCharArray(); for (char ch : messageArray) { messageArrayList.add(ch); } } public boolean pressEnter() { keyboard.typeKey((char)13); keyboard.typeKey((char)10); return true; } } Its not much but I'm proud of it, gets the job done 1 Quote Link to comment Share on other sites More sharing options...