Jump to content

Faster typing!


ninjamuffinz

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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