Jump to content

Typing instantly


Recommended Posts

Posted (edited)

So this is a snippet I wrote as a reply to a thread, but it's pretty buried and some people may find it useful:

public final void typeStringInstant(final String output){
    for(int i = 0; i < output.length(); i ++){
        getBot().getKeyEventHandler().generateBotKeyEvent(KEY_TYPED, System.currentTimeMillis(), 0, VK_UNDEFINED, output.charAt(i));
    }
    getBot().getKeyEventHandler().generateBotKeyEvent(KEY_TYPED, System.currentTimeMillis(), 0, VK_UNDEFINED, (char) VK_ENTER);
}
Edited by Explv
  • Like 8
  • 5 months later...
  • 1 month later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...