Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Runescape Revision Check
#1
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:
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
BUILD SUCCESSFUL (total time: 9 seconds)
609 = current RS version
My SMF Modifications:
http://anthony.vibrantvps.com/smf
Reply


Messages In This Thread
Runescape Revision Check - by Project Evolution - 05-21-2010, 02:40 PM
RE: Runescape Revision Check - by delme - 05-22-2010, 10:23 PM
RE: Runescape Revision Check - by alfonzo1955 - 05-23-2010, 01:08 PM
RE: Runescape Revision Check - by Statics - 05-23-2010, 02:03 PM
RE: Runescape Revision Check - by tsgh mike - 08-03-2010, 10:37 PM
RE: Runescape Revision Check - by wchar_t - 08-06-2010, 01:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Runescape Servers Sub 43 7,713 10-19-2009, 06:09 PM
Last Post: ReVamped

Forum Jump:


Users browsing this thread: 1 Guest(s)