SRL Archive - Java Help and Tutorials

ScrollBot - yeah, now its easier to read appliances' scripts!


n3ss3s

2007-08-02 11:43:16

Its nothing big, just a small snippet.

import java.awt.Robot;
import java.awt.event.KeyEvent;
// by n3ss3s
// Only for educational purposes or scrolling.
class ScrollBot {

public static void main (String [] args) throws Exception {
int speed = 500; // Time between a scroll
int i = 0;
int scrolls = 1000; // How many times to scroll
Robot robo = new Robot();
while (!(i == scrolls) {
robo.mouseWheel(1);
robo.delay(speed);
i ++;
}

}
}

Donations will be accepted lol

GoF

2007-08-03 06:54:18

Nice, nice…

n3ss3s

2007-08-03 08:35:47

I'd make a java typeSend but I dont know what to use for getting the key code.

GoF

2007-08-04 12:04:22

Hm. Is that necessary? Because wouldn't something like this work:

public void typeSend(String typewhat, int delay ) throws Exception {
int a = 0;
int b = 0;
int txtLength = typewhat.length();
char[] theTxt = new char[txtLength];
if (typewhat != null && typewhat.length() > 0) {
for( a = 0; a < txtLength; a++) {
theTxt[a] = typewhat.charAt(a);
}
for(b = 0; b < theTxt.length; b++) {
//Something to send the character..
Thread.sleep(delay);
}
}
}

Just takes all the characters from the string to an array.. Then would send the characters 1 by one.. Not sure at all because I just quickly put that together and didn't test.

Bobarkinator

2007-08-04 13:13:47

Don't you need to make them private ints?

GoF

2007-08-05 07:51:45

Hm.. I doubt.

n3ss3s

2007-08-05 11:59:30

GoF, I would but I need to use the KeyEvent class to get the keycodes to use keyPress() and theres sooo many things to put in the constructor and I have no idea what to use there..

Santa_Clause

2007-08-06 06:03:29

Sorry for not knowing anything about Java…but how the hell do I run this?

Also, are you going to post a picture on your millenium thread n3ss3s?

n3ss3s

2007-08-06 07:53:57

I could… I hope millenium means 1000 or like that :D

Is it supposed to be funny or..?

EDIT: Nope, I wont post a pic, Ill post a script :)

Santa_Clause

2007-08-07 09:48:39

Ok…now how do I run this JAVA application thing?

Hugolord

2007-08-07 09:49:47

im guessing save it on notepad as .jar?

n3ss3s

2007-08-07 09:52:28

Nooo! You have to compile into a class file either using javac straight on tha cmd or then use textpad or sumting.. Then, you just type to cmd "java Scrollbot"

Smartzkid

2007-08-07 09:53:45

Save it in notepad as .java, compile it into a .class (javac.exe?), then run it with…java.exe?

Hugolord

2007-08-07 09:54:13

oh right woops my bad sorry lol

n3ss3s

2007-08-07 09:58:00

yes.

Harry

2007-08-07 10:57:14

Yeah, is there a tut somewhere on how to run JAVA? It is my first time .. I sdon't really understand what you are saying .. how do I compile it into a .class and where is java.exe and javac.exe?

:noob alert: :p lol

-Harry

n3ss3s

2007-08-08 04:43:51

You need to have Java Development Kit (JDk) which you can dl from Java's home. (java.sun.com I think).

Then, (Java.exe is in your JRE/bin folder in your Java folder and Javac.exe is in your JDK/bin folder in your Java folder.

Then.. god damit im too lazy to explain, just download JDK and textpad or netbeans or notepad++ and open the file with one of those and press compile and then press run lmao.

Santa_Clause

2007-08-08 06:48:07

I am so not going to bother…

GoF

2007-08-08 06:57:12

Like hundreds of mb's to dl just to run scrollbot :)

n3ss3s

2007-08-08 07:11:00

I havent said anyone should bother :)

EDIT: Lol, you cant play runescape without Java, you cant run any Java without Java.

The Element

2007-08-10 17:56:22

Wrong. You can run runescape with the JRE. Only the JDK comes with javac.exe etc.

n3ss3s

2007-08-11 06:14:26

:duh:

If you have JRE then you have Java.

So, you cant run runescape without Java.

JDK is Java Development Kit and that you DONT need to play rs…