Skip to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Instant Keyboard Typer

Featured Replies

I need help finding a keyboard that types instantly. I used one in the past but it doesn't seem to work anymore and I'm not sure what exactly the issue is. It can be found in this thread here:

The solution (which worked in the past) was given by @Explv

 

Thank you.

Edited by glide

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);
}

 

This works almost fine for me. You have to change one thing with the Press enter and release enter. I bet the method generateBotKeyEvent was updated because it shouldn't have the 1 at the end.

Instead it should be getBot().getKeyEventHandler().generateBotKeyEvent(401, System.currentTimeMillis(), 0, 10, '\u0000');

and getBot().getKeyEventHandler().generateBotKeyEvent(402, System.currentTimeMillis(), 0, 10, '\u0000');

Of course there is also some natural delay between when the chat is sent and when it appears, but it instantly types and sends the message.

The code I tested this with and worked is here:

 

package net.chatbox.instantchat;

import java.awt.event.KeyEvent;

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "Helper", info = "Instant Chat", logo = "", name = "Instant Chatter", version = 0)
public class InstantChat extends Script{

	@Override
	public int onLoop() throws InterruptedException {
		return 100;
	}

	public void onStart(){
		typeStringInstant("This probably will work just fine for me");
	}
	
	public void onExit() {
		typeStringInstant("Double-checking this");
	}
	
	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');
	    // Release enter
	    getBot().getKeyEventHandler().generateBotKeyEvent(402, System.currentTimeMillis(), 0, 10, '\u0000');
	}
	
	
	
	
	
	
	
	
}

 

  • Author
2 hours ago, jakealaka9 said:

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);
}

 

This works almost fine for me. You have to change one thing with the Press enter and release enter. I bet the method generateBotKeyEvent was updated because it shouldn't have the 1 at the end.

Instead it should be getBot().getKeyEventHandler().generateBotKeyEvent(401, System.currentTimeMillis(), 0, 10, '\u0000');

and getBot().getKeyEventHandler().generateBotKeyEvent(402, System.currentTimeMillis(), 0, 10, '\u0000');

Of course there is also some natural delay between when the chat is sent and when it appears, but it instantly types and sends the message.

The code I tested this with and worked is here:

 


package net.chatbox.instantchat;

import java.awt.event.KeyEvent;

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "Helper", info = "Instant Chat", logo = "", name = "Instant Chatter", version = 0)
public class InstantChat extends Script{

	@Override
	public int onLoop() throws InterruptedException {
		return 100;
	}

	public void onStart(){
		typeStringInstant("This probably will work just fine for me");
	}
	
	public void onExit() {
		typeStringInstant("Double-checking this");
	}
	
	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');
	    // Release enter
	    getBot().getKeyEventHandler().generateBotKeyEvent(402, System.currentTimeMillis(), 0, 10, '\u0000');
	}
	
	
	
	
	
	
	
	
}

 

Thank you so much! It works perfectly.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.