Jump to content

Typing issue


Ayylmao420

Recommended Posts

	public void typeString(final String string) throws InterruptedException {
		for (Character character : string.toCharArray()) {
			getBot().getKeyEventHandler().generateBotKeyEvent(KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, KeyEvent.getExtendedKeyCodeForChar(character), character);
			sleep(random(50, 100));
			getBot().getKeyEventHandler().generateBotKeyEvent(KeyEvent.KEY_RELEASED, System.currentTimeMillis(), 0, KeyEvent.getExtendedKeyCodeForChar(character), character);	
		}
	}

So i came up with this but doesn't work, could someone help me out ?

Link to comment
Share on other sites

15 hours ago, Juggles said:

                                getKeyboard().pressKey(KeyEvent.VK_PAGE_UP);

                                getKeyboard().pressRelease(KeyEvent.VK_PAGE_UP);

 

for (Character character : string.toCharArray()) {
		getKeyboard().pressKey(KeyEvent.getExtendedKeyCodeForChar(character));
		sleep(random(50, 100));
		getKeyboard().releaseKey(KeyEvent.getExtendedKeyCodeForChar(character));
}

Doesn't seem to work either, am i doing something wrong ?

@Alek

Edited by Ayylmao420
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...