05-21-2010, 02:40 PM
Code:
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
public class lol {
public static void main(String[] args) {
try {
System.out.println(getRSVersion(595));
} catch (IOException ex) {
ex.printStackTrace();
System.out.println("Exception Thrown!");
}
}
static int getRSVersion(int revision) throws IOException {
int rsVersion = revision;
String version = "";
boolean found = false;
Socket sock = null;
OutputStream out = null;
InputStream in = null;
do {
sock = new Socket("world1.runescape.com", 43594);
out = sock.getOutputStream();
in = sock.getInputStream();
byte[] sentBytes = { 15, (byte)(rsVersion >> 24), (byte)(rsVersion >> 16),
(byte)(rsVersion >> 8), (byte)rsVersion };
out.write(sentBytes);
sentBytes = new byte[1];
int readBytes = in.read();
if (readBytes != 0) {
System.out.println(rsVersion);
rsVersion++;
} else {
found = true;
out.close();
in.close();
sock.close();
}
} while (!found);
return rsVersion;
}
}
Quote:run-single:609 = current RS version
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
BUILD SUCCESSFUL (total time: 9 seconds)