• Log in or sign up for an account here: https://www.sythe.org/login

Reading things that have been printed to console?

SuF

Legend

Pirate
Retired Global Moderator
Joined
Jan 21, 2007
Sythe Gold
1,234
Messages
14,211
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
Basically, I am making a RS client that downloads the client and runs it from my computer, mainly for practice, but also because I like to get on at school sometimes... I want to make an updater that downloads runescape.jar when RS is outdated... I know that RS is outdated since RS prints je_connect5 or something like that to the console... I need to find out if it printed that so I can download the new RS.jar automatically... :/

I was looking at RSBOT source, but I did not get anything useful from that... :/
 
Find what triggers the error to be sent to the console, then just add an if-statement.

Code:
if() { //rs.jar is outdated
//replace rs.jar
} else {
//run normally

Look in RsBot's source code and find out why it prints "error_js5_game_connect" or whatever it does to get the condition for the if-statement.

Alternatively, you could have a look around in the Scanner API and see if you can find anything of use.


Edit: Another thing you could do, is ask around in MITB's client hacking section (don't mention Sythe for your own good, though o.O)
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
Find what triggers the error to be sent to the console, then just add an if-statement.

Code:
if() { //rs.jar is outdated
//replace rs.jar
} else {
//run normally

Look in RsBot's source code and find out why it prints "error_js5_game_connect" or whatever it does to get the condition for the if-statement.

Alternatively, you could have a look around in the Scanner API and see if you can find anything of use.


Edit: Another thing you could do, is ask around in MITB's client hacking section (don't mention Sythe for your own good, though o.O)

The error is sent by the RS client... RSBOT uses some sort of Scanner to know when it has been passed, but I do not understand it...


Also, anyone know how to make 2 clients run at the same time? the second one always errors when i try and run two... >.<
 
actualy wuld probably look more like this...

if (outdated) {
javaPos(50000000ms);
printLN("now downloading new jar...");
Download(new jar's link);
} else {
loadNorm();
}


4 the lulz of course :D
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
I think I may have figured this out due to the stupid client the RSBOT guy made... I still need to test but what ever... New point... I can not run 2 RS's.. they both crash if i do... any ideas?
 
I want to make an updater that downloads runescape.jar when RS is outdated... I know that RS is outdated since RS prints je_connect5 or something like that to the console... I need to find out if it printed that so I can download the new RS.jar automatically... :/

I suggest you take a look around mitb.
You are going the completely wrong way about it.
 
Moparisthebest, crappy rsps forum. Shouldn't you just look inside of the client for the location of the printed message?
 
Code:
import java.io.*;
import java.net.*;

public class RSDL {

	private static File fileName = new File("URLCheck.txt");
	private static File jarName = new File("runescape.jar");
	public static String oldURL = "";

	public static void main(String args[]) {
		if (!oldURL.contains("outofdate")) {
			if (!fileName.exists()) {
				try {
					fileName.createNewFile();
				} catch(Exception e) { }
			} else {
				try {
					fileName.delete();
					fileName.createNewFile();
				} catch(Exception e) { }
			}
			try {
         		BufferedInputStream inStream = null;
         		BufferedOutputStream outStream = null;
         		try {
					URL url = new URL("http://world37.runescape.com/runescape.jar");
					URLConnection urlc = url.openConnection();

					inStream = new BufferedInputStream( urlc.getInputStream() );
					outStream = new BufferedOutputStream( new FileOutputStream( jarName.getName() ) );

					if (!jarName.exists()) {
						try {
							jarName.createNewFile();
						} catch(Exception e) { }
					} else {
						try {
							jarName.delete();
							jarName.createNewFile();
						} catch(Exception e) { }
					}

            		int classes;
            		while ((classes = inStream.read()) != -1) {
               			outStream.write(classes);
            		}
         	} finally {
            	if (inStream != null)
            	   	try {
            	      	inStream.close();
            	   	} catch (IOException d) {
            	      	d.printStackTrace();
            	   	}
            	if (outStream != null)
            	   	try {
            	      	outStream.close();
            	   	} catch (IOException d) {
            	      	d.printStackTrace();
            	   	}
         	}
			} catch(Exception e) {
				System.out.println("Problem downloading the file: runescape.jar.\n" + e);
			}
		} else {
			System.out.println("Runescape.jar is up-to-date.");
		}
	}
}

The download bit works perfectly, you just have to make it check the "outofdate" string for it work the way you described. I noticed a method labeled "showDocument" in BotStub class in the Bot.com.speljohan.rsbot.bot directory. Unfortunately, I could not find where it was executed.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
Code:
import java.io.*;
import java.net.*;

public class RSDL {

	private static File fileName = new File("URLCheck.txt");
	private static File jarName = new File("runescape.jar");
	public static String oldURL = "";

	public static void main(String args[]) {
		if (!oldURL.contains("outofdate")) {
			if (!fileName.exists()) {
				try {
					fileName.createNewFile();
				} catch(Exception e) { }
			} else {
				try {
					fileName.delete();
					fileName.createNewFile();
				} catch(Exception e) { }
			}
			try {
         		BufferedInputStream inStream = null;
         		BufferedOutputStream outStream = null;
         		try {
					URL url = new URL("http://world37.runescape.com/runescape.jar");
					URLConnection urlc = url.openConnection();

					inStream = new BufferedInputStream( urlc.getInputStream() );
					outStream = new BufferedOutputStream( new FileOutputStream( jarName.getName() ) );

					if (!jarName.exists()) {
						try {
							jarName.createNewFile();
						} catch(Exception e) { }
					} else {
						try {
							jarName.delete();
							jarName.createNewFile();
						} catch(Exception e) { }
					}

            		int classes;
            		while ((classes = inStream.read()) != -1) {
               			outStream.write(classes);
            		}
         	} finally {
            	if (inStream != null)
            	   	try {
            	      	inStream.close();
            	   	} catch (IOException d) {
            	      	d.printStackTrace();
            	   	}
            	if (outStream != null)
            	   	try {
            	      	outStream.close();
            	   	} catch (IOException d) {
            	      	d.printStackTrace();
            	   	}
         	}
			} catch(Exception e) {
				System.out.println("Problem downloading the file: runescape.jar.\n" + e);
			}
		} else {
			System.out.println("Runescape.jar is up-to-date.");
		}
	}
}

The download bit works perfectly, you just have to make it check the "outofdate" string for it work the way you described. I noticed a method labeled "showDocument" in BotStub class in the Bot.com.speljohan.rsbot.bot directory. Unfortunately, I could not find where it was executed.


What does this do besides download rs.jar?
 
As is, it's configured to either download runescape.jar if it doesn't exist, or delete the current runescape.jar you have in the folder and then download an updated one. Done correctly, you can make it check if it's already up-to-date.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
As is, it's configured to either download runescape.jar if it doesn't exist, or delete the current runescape.jar you have in the folder and then download an updated one. Done correctly, you can make it check if it's already up-to-date.

How would it check if its up to date?
 
If you look at the "showDocument" method in RSBot and can find where it's executed, then you will be able to find out.

Must be something to do with the URL.

The method:

Code:
	public void showDocument(URL url) {
		if(url.toString().contains("outofdate")) {
			log("===============================================================================");
			log("RSBot is currently outdated, please wait patiently for an update.");
			log("Posting a duplicate thread or a thread somewhere other than ");
			log("the download section will result in an instant BAN.");
			log("===============================================================================");
		} else {
			log("Attempting to show: " + url.toString());
		}
	}
 
Couldn't you compare the MD5 hashes / timestamps / something else to check if the yours is older than the current one?
 
Older doesn't always mean that the file you have is an earlier version.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
If you look at the "showDocument" method in RSBot and can find where it's executed, then you will be able to find out.

Must be something to do with the URL.

The method:

Code:
	public void showDocument(URL url) {
		if(url.toString().contains("outofdate")) {
			log("===============================================================================");
			log("RSBot is currently outdated, please wait patiently for an update.");
			log("Posting a duplicate thread or a thread somewhere other than ");
			log("the download section will result in an instant BAN.");
			log("===============================================================================");
		} else {
			log("Attempting to show: " + url.toString());
		}
	}

:O. I was going to use that but I forgot about it... RS calls that to make the browser go to the RS is outdated URL... :)
 
What does this do besides download rs.jar?

Ok you don't understand the code O.o

Im sorry but why are you making a rs client if you can't even understand basic code such as this?

Maybe you should do some studying before programming a client otherwise your account and many others could get banned.
 
Reading this is like looking at monkey trying to open a metal can with a branch -_-"

If you seriously want to learn how to create client hacks, visit my community at http://rs-hacking.com and check out the turorial section...

As for this problem, ever considered just getting the version number from the client using BCEL and querying the server for the latest version number and then compare those?
 
Runescape Gamblingrunescape gambling
Back
Top