- Joined
- Nov 23, 2006
- Sythe Gold
- 1,609
- Messages
- 7,145
- Location
- Canada
- Discord Unique ID
- 178533992981594112
I'm writing an autotalker. It works great in general purpose applications like Notepad and even Old School Runescape, but it doesn't work in modern Runescape for some weird reason.
If you select the option to add a new line at the end of your message, modern RS will move the chat window to the search window (as if it had pressed enter first before sending a message):
Then it'll search for the autotalker's output.
The character sequence is as simple as this: "hello\n" as an example. I've tried combinations with \r as well.
My code is simple, I'm not doing anything crazy. Just using the Robot class.
Here's my code:
Usage:
Sending VK_ENTER with Robot yields the same effect.
Ideas?
EDIT:
Basic SendKeys.Send() code in C# doesn't invoke the search box, but it glitches out pretty heavily:
This was trying to send "Boogers\n"
If you select the option to add a new line at the end of your message, modern RS will move the chat window to the search window (as if it had pressed enter first before sending a message):
Then it'll search for the autotalker's output.
The character sequence is as simple as this: "hello\n" as an example. I've tried combinations with \r as well.
My code is simple, I'm not doing anything crazy. Just using the Robot class.
Here's my code:
Code:
package botkitfx.Classes;
import java.awt.*;
import java.awt.event.*;
import java.util.Random;
public class KeyController
{
Robot robot;
public KeyController() throws AWTException
{
robot = new Robot();
}
public void SendChar(char c)
{
int keycode = KeyEvent.getExtendedKeyCodeForChar(c);
robot.keyPress(keycode);
}
public void SendKeys(String text, int humanDelay, int humanOffset, boolean newline)
{
char[] textArr = text.toCharArray();
for(char c : textArr)
{
int trueDelay;
if (humanOffset > 0 && humanDelay > 0)
trueDelay = humanDelay + (new Random()).nextInt(humanOffset);
else if(humanOffset == 0 && humanDelay > 0)
trueDelay = humanDelay;
else
trueDelay = 0;
SendChar(c);
}
if (newline == true)
{
SendChar('\n');
}
}
}
Usage:
Code:
SendKeys("hello", 0, 0, true);
Sending VK_ENTER with Robot yields the same effect.
Ideas?
EDIT:
Basic SendKeys.Send() code in C# doesn't invoke the search box, but it glitches out pretty heavily:
This was trying to send "Boogers\n"
Last edited:





























