Jump to content

Faster typing!


Recommended Posts

Posted

Is there a way have my bot type a message faster than using

 

getKeyboard.typeString(); 

 

I would like the message to be typed instantly, it doesn't matter if it's obvious if ts a bot. I have tried the smart typer posted on these forums but I cant seem to get it to work properly (Throws an exception) 

 

Is there a simple way of doing this?

 

Thanks in advance.

Posted (edited)

See my post here for a working solution:

http://osbot.org/forum/topic/85684-finished-my-new-script-but-how-do-i-type-faster/?p=952925

I would paste the code but I'm on my phone

 

 

Edit (pasted code here):

private void typeStringInstant(String output){

    for(int i = 0; i < output.length(); i ++){

        char c = output.charAt(i);
        int code = KeyEvent.getExtendedKeyCodeForChar(c);
        // Type the character
        getBot().getKeyEventHandler().generateBotKeyEvent(400, System.currentTimeMillis(), 0, code, c);
    }

    // Press enter
    getBot().getKeyEventHandler().generateBotKeyEvent(401, System.currentTimeMillis(), 0, 10, '\u0000', 1);
    // Release enter
    getBot().getKeyEventHandler().generateBotKeyEvent(402, System.currentTimeMillis(), 0, 10, '\u0000', 1);
}
Edited by Explv

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...