Reading things that have been printed to console?

Discussion in 'Programming General' started by SuF, Feb 8, 2009.

Reading things that have been printed to console?
  1. Unread #1 - Feb 8, 2009 at 12:38 PM
  2. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Reading things that have been printed to console?

    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... :/
     
  3. Unread #2 - Feb 8, 2009 at 3:48 PM
  4. Benz
    Joined:
    Apr 30, 2007
    Posts:
    255
    Referrals:
    0
    Sythe Gold:
    0

    Benz Forum Addict

    Reading things that have been printed to console?

    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)
     
  5. Unread #3 - Feb 8, 2009 at 4:01 PM
  6. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Reading things that have been printed to console?

    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... >.<
     
  7. Unread #4 - Feb 8, 2009 at 6:24 PM
  8. SilabGarza
    Joined:
    Dec 26, 2008
    Posts:
    108
    Referrals:
    1
    Sythe Gold:
    0

    SilabGarza Active Member
    Banned

    Reading things that have been printed to console?

    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
     
  9. Unread #5 - Feb 9, 2009 at 9:14 PM
  10. Benz
    Joined:
    Apr 30, 2007
    Posts:
    255
    Referrals:
    0
    Sythe Gold:
    0

    Benz Forum Addict

    Reading things that have been printed to console?


    That's disgusting. Go back to RSPS.
     
  11. Unread #6 - Feb 9, 2009 at 9:18 PM
  12. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Reading things that have been printed to console?

    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?
     
  13. Unread #7 - Feb 11, 2009 at 5:20 AM
  14. Wehrmacht
    Joined:
    Jan 14, 2009
    Posts:
    24
    Referrals:
    0
    Sythe Gold:
    0

    Wehrmacht Newcomer

    Reading things that have been printed to console?

    I suggest you take a look around mitb.
    You are going the completely wrong way about it.
     
  15. Unread #8 - Feb 11, 2009 at 9:55 AM
  16. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Reading things that have been printed to console?

    What is mitb?
     
  17. Unread #9 - Mar 12, 2009 at 4:36 PM
  18. Epic Anomaly
    Joined:
    Jan 21, 2009
    Posts:
    315
    Referrals:
    0
    Sythe Gold:
    0

    Epic Anomaly Forum Addict
    Banned

    Reading things that have been printed to console?

    Moparisthebest, crappy rsps forum. Shouldn't you just look inside of the client for the location of the printed message?
     
  19. Unread #10 - Mar 20, 2009 at 9:31 PM
  20. Revel
    Joined:
    Mar 19, 2009
    Posts:
    20
    Referrals:
    0
    Sythe Gold:
    0

    Revel Newcomer

    Reading things that have been printed to console?

    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.
     
  21. Unread #11 - Mar 20, 2009 at 9:52 PM
  22. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Reading things that have been printed to console?


    What does this do besides download rs.jar?
     
  23. Unread #12 - Mar 20, 2009 at 9:58 PM
  24. Revel
    Joined:
    Mar 19, 2009
    Posts:
    20
    Referrals:
    0
    Sythe Gold:
    0

    Revel Newcomer

    Reading things that have been printed to console?

    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.
     
  25. Unread #13 - Mar 20, 2009 at 10:01 PM
  26. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Reading things that have been printed to console?

    How would it check if its up to date?
     
  27. Unread #14 - Mar 20, 2009 at 10:03 PM
  28. Revel
    Joined:
    Mar 19, 2009
    Posts:
    20
    Referrals:
    0
    Sythe Gold:
    0

    Revel Newcomer

    Reading things that have been printed to console?

    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());
    		}
    	}
     
  29. Unread #15 - Mar 21, 2009 at 12:29 PM
  30. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Reading things that have been printed to console?

    Couldn't you compare the MD5 hashes / timestamps / something else to check if the yours is older than the current one?
     
  31. Unread #16 - Mar 21, 2009 at 3:39 PM
  32. Revel
    Joined:
    Mar 19, 2009
    Posts:
    20
    Referrals:
    0
    Sythe Gold:
    0

    Revel Newcomer

    Reading things that have been printed to console?

    Older doesn't always mean that the file you have is an earlier version.
     
  33. Unread #17 - Mar 21, 2009 at 9:00 PM
  34. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Reading things that have been printed to console?

    :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... :)
     
  35. Unread #18 - Mar 22, 2009 at 7:08 AM
  36. Makoto_Nagano
    Joined:
    Feb 23, 2009
    Posts:
    140
    Referrals:
    0
    Sythe Gold:
    0

    Makoto_Nagano Active Member
    Banned

    Reading things that have been printed to console?

    thats pretty cool gl
     
  37. Unread #19 - Mar 22, 2009 at 9:19 AM
  38. Stuart
    Joined:
    May 5, 2005
    Posts:
    1,580
    Referrals:
    2
    Sythe Gold:
    10

    Stuart Guru
    Banned

    Reading things that have been printed to console?

    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.
     
  39. Unread #20 - Mar 22, 2009 at 9:40 AM
  40. freddy1990
    Joined:
    Jul 1, 2005
    Posts:
    149
    Referrals:
    1
    Sythe Gold:
    0

    freddy1990 Active Member

    Reading things that have been printed to console?

    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?
     
< :] | Java Clue Solver (CLUE! not RS Clue Scrolls) >

Users viewing this thread
1 guest


 
 
Adblock breaks this site