Runescape Client

Discussion in 'Programming General' started by Sieu Phan, Sep 5, 2012.

Runescape Client
  1. Unread #1 - Sep 5, 2012 at 3:37 AM
  2. Sieu Phan
    Joined:
    Dec 16, 2011
    Posts:
    746
    Referrals:
    0
    Sythe Gold:
    0

    Sieu Phan Apprentice
    Banned

    Runescape Client


    IF THIS ISN'T ALLOWED REMOVE IT.


    Just for anyone who needs it :p

    www.sieuphan.com/download.html

    www.sieuphan.com/download.html

    www.sieuphan.com/download.html




    [​IMG]


    features:
    -Pornhub quick access (has age disclaimer)
    -Sythe quick access
    -Screenshot
    -Autotyper.. in the progress of being made

    Pretty much... this checks for updates, downloads it, and puts the applet into a frame :p OH YEA AND NO AD's FOR F2P USERS :)

    MAKE A FOLDER AND PUT ALL OF THE FOLLOWING IN IT.

    1st, make a class named Rs_Client.java and paste the following:

    Code:
    import java.applet.Applet;
    import java.applet.AppletContext;
    import java.applet.AppletStub;
    import java.awt.BorderLayout;
    import java.awt.Desktop;
    import java.awt.Dimension;
    import java.awt.KeyboardFocusManager;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.Robot;
    import java.awt.Toolkit;
    import java.awt.Window;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.image.BufferedImage;
    import java.io.DataInputStream;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintStream;
    import java.net.URI;
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.net.URLConnection;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.Map;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.imageio.ImageIO;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JOptionPane;
    import javax.swing.UIManager;
    
    
    public class Rs_Client implements AppletStub, ActionListener {
    	private Map<String, String> parameters = new HashMap();
    	private URL documentBase;
    	private URL codeBase;
    	public static final Pattern SOURCE_PATTERN = Pattern.compile("src=\"(.*)\" ");
    	public static final Pattern ARCHIVE_PATTERN = Pattern.compile("archive=(.*) ");
    	public static final Pattern CODE_PATTERN = Pattern.compile("code=(.*) ");
    	public static final Pattern PARAMETER_PATTERN = Pattern.compile("<param name=\"([^\\s]+)\"\\s+value=\"([^>]*)\">");
    	public static int i = 0;
    	public Rs_Client()
    	throws Exception
    	{
    		loadRunescape();
    	}
    
    	public void centreWindow(Window paramWindow) {
    		Dimension localDimension = Toolkit.getDefaultToolkit().getScreenSize();
    		int i = (int) ((localDimension.getWidth() - paramWindow.getWidth()) / 2.0D);
    		int j = (int) ((localDimension.getHeight() - paramWindow.getHeight()) / 2.0D);
    		paramWindow.setLocation(i, j);
    	}
    
    	public Rs_Client(Pattern paramPattern, String paramString) {
    		Matcher localMatcher = paramPattern.matcher(paramString);
    			while (localMatcher.find()) {
    			String str1 = localMatcher.group(1);
    			String str2 = localMatcher.group(2);
    			this.parameters.put(str1, str2);
    			System.out.println("Parameter loaded.  Key = " + str1 + ", Value = " + str2);
    		}
    	}
    
    	public void loadRunescape() throws Exception {
    		
    		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    		System.out.println("Generating applet information...");
    		JFrame localJFrame = new JFrame("Sieu's Runescape Client");
    		JLabel localJLabel = new JLabel();
    		ImageIcon localImageIcon = new ImageIcon(new URL("http://www.runescape.com/img/game/splash.gif"));
    		JMenuBar menuBar = new JMenuBar();
    		
    		JButton porn = new JButton("PornHub");
    		JButton sythe = new JButton("Sythe");
    		JButton autoTyper = new JButton("Autotyper");
    		JButton screenShot = new JButton("Screenshot");
    		JButton about = new JButton("About");
    		sythe.setActionCommand("Sythe");
    		screenShot.setActionCommand("Screenshot");
    		autoTyper.setActionCommand("Autotyper");
    		about.setActionCommand("About");
    		porn.setActionCommand("Pornhub");
    		about.addActionListener(this);
    		screenShot.addActionListener(this);
    		porn.addActionListener(this);
    		sythe.addActionListener(this);
    		autoTyper.addActionListener(this);
    		
    
    		localJFrame.pack();
    		localJFrame.setVisible(true);
    		localImageIcon.setImageObserver(null);
    		localJLabel.setIcon(localImageIcon);
    		localJFrame.add(localJLabel);
    		localJFrame.pack();
    		centreWindow(localJFrame);
    		localJFrame.setVisible(true);
    		String str1 = getPageSource(new URL("http://www.runescape.com/game.ws?j=1"));
    		Matcher localMatcher1 = SOURCE_PATTERN.matcher(str1);
    		if (localMatcher1.find()) {
    			String str2 = localMatcher1.group(1);
    			String str3 = getPageSource(new URL(str2));
    			localMatcher1 = ARCHIVE_PATTERN.matcher(str3);
    			Matcher localMatcher2 = CODE_PATTERN.matcher(str3);
    			if ((localMatcher1.find()) && (localMatcher2.find())) {
    				Rs_Client localRs_Client = new Rs_Client(
    						PARAMETER_PATTERN, str3);
    				URL localURL = new URL(str2.substring(0,
    						str2.indexOf("/,")));
    				String str4 = localMatcher2.group(1);
    				localRs_Client.setCodeBase(localURL);
    				localRs_Client.setDocumentBase(localURL);
    				String str5 = localMatcher1.group(1);
    				System.out.println("Downloading " + str5 + " from "
    						+ localURL + ".");
    				
    				Download(localURL.toString() + "/", str5);
    				System.out
    						.println("Download finished. Saved to gamepack.jar. Parsing applet...");
    				
    				Applet localApplet = (Applet) new URLClassLoader(
    						new URL[] { new File("./gamepack.jar").toURI().toURL() })
    						.loadClass(str4.replaceAll(".class", "")).newInstance();
    				
    				localApplet.setStub(localRs_Client);
    				localApplet.init();
    				localApplet.start();
    				localApplet.setPreferredSize(new Dimension(763, 578));
    				localJFrame.add(localApplet);
    				localJFrame.pack();
    				centreWindow(localJFrame);
    				localJFrame.setDefaultCloseOperation(3);
    				localJLabel.setVisible(false);
    						menuBar.add(porn);
    		menuBar.add(sythe);
    		menuBar.add(autoTyper);
    		menuBar.add(screenShot);
    		menuBar.add(about);
    		localJFrame.getContentPane().add(menuBar, BorderLayout.NORTH);
    			}
    		}
    	}
    
    	private static void openUpWebSite(String url) {
    		Desktop d = Desktop.getDesktop();
    		try {
    			d.browse(new URI(url)); 	
    		} catch (Exception e) {
    		}
    	}
      	public JFrame frame; 
    	public void actionPerformed(ActionEvent evt) 
    	{
    		String cmd = evt.getActionCommand();
    
    		if (cmd != null) 
    		{
    			if (cmd.equalsIgnoreCase("About")) {
    				JOptionPane.showMessageDialog(frame, "Sieu Phan ^_^");
    			} 
    			if(cmd.equalsIgnoreCase("Screenshot")) {
    				screenShot();
    			}
    			if(cmd.equalsIgnoreCase("Pornhub")) {
    				porn();
    			}
    			if(cmd.equalsIgnoreCase("Sythe")) {
    			
    				openUpWebSite("www.sythe.org");
    			}
    			if(cmd.equalsIgnoreCase("Autotyper")) {
    				JOptionPane.showMessageDialog(frame, "Work in progress...");
    			}
    		}
    	}
        public void porn(){
    	    int reply = JOptionPane.showConfirmDialog(null, "This is an adult website, are you 18+?", "Age Disclaimer", JOptionPane.YES_NO_OPTION);
            if (reply == JOptionPane.YES_OPTION) {
              openUpWebSite("www.pornhub.com");
            }
            else {
            JOptionPane.showMessageDialog(null,"Denied");
            }
    	}
    
    	public static void screenShot() {
    		try
    		{
    			Window window = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow();
    			Point point = window.getLocationOnScreen();
    			int x = (int)point.getX();
    			int y = (int)point.getY();
    			int w = window.getWidth();
    			int h = window.getHeight();
    			Rectangle captureSize = new Rectangle(x, y, w, h);
    			Robot robot = new Robot();
    			BufferedImage image = robot.createScreenCapture(captureSize);
    			File file;
    			i++;
    			String name = JOptionPane.showInputDialog ("Please type in a name for the screenshot:", "default"); 
    			file = new File("Screenshots/"+ name +".jpg");
    			if (file.exists()) {
    			JOptionPane.showMessageDialog(null,"File already exist.");
    			}
    			else if (name != null){
    			ImageIO.write(image, "jpg", file);
    			JOptionPane.showMessageDialog(null,"Screenshot Saved To: /Screenshots/"+ name +".jpg");
    			}
    			else {
    			JOptionPane.showMessageDialog(null,"Picture Deleted");
    			}
    			
    		}
    		catch (Exception e)
    		{
    			System.out.println(e.getMessage());
    		}
    	}
    	
    	private String getPageSource(URL paramURL) throws IOException, InterruptedException {
    		URLConnection localURLConnection = paramURL.openConnection();
    		localURLConnection.addRequestProperty("Accept", "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5");
    		localURLConnection.addRequestProperty("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
    		localURLConnection.addRequestProperty("Accept-Encoding", "gzip,deflate");
    		localURLConnection.addRequestProperty("Accept-Language", "en-gb,en;q=0.5");
    		localURLConnection.addRequestProperty("Connection", "keep-alive");
    		localURLConnection.addRequestProperty("Host", "www.runescape.com");
    		localURLConnection.addRequestProperty("Keep-Alive", "300");
    		localURLConnection.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1");
    		DataInputStream localDataInputStream = new DataInputStream(
    		localURLConnection.getInputStream());
    		byte[] arrayOfByte = new byte[localURLConnection.getContentLength()];
    		localDataInputStream.readFully(arrayOfByte);
    		localDataInputStream.close();
    		return new String(arrayOfByte);
    	}
    
    	
    	public void Download(String paramString1, String paramString2) throws Exception {
    		URLConnection localURLConnection = new URL(paramString1 + paramString2).openConnection();
    		FileOutputStream localFileOutputStream = new FileOutputStream("./gamepack.jar");
    		InputStream localInputStream = localURLConnection.getInputStream();
    		byte[] arrayOfByte = new byte[1024];
    		int i;
    		while ((i = localInputStream.read(arrayOfByte)) != -1)
    		localFileOutputStream.write(arrayOfByte, 0, i);
    	}
    
    	
    	public static void main(String[] paramArrayOfString) throws Exception {
    		new Rs_Client();
    	}
    
    	
    	public void setDocumentBase(URL paramURL) {
    		this.documentBase = paramURL;
    	}
    
    	
    	public void setCodeBase(URL paramURL) {
    		this.codeBase = paramURL;
    	}
    
    	
    	public boolean isActive() {
    		return true;
    	}
    
    	
    	public URL getDocumentBase() {
    		return this.documentBase;
    	}
    
    	
    	public URL getCodeBase() {
    		return this.codeBase;
    	}
    
    	
    	public String getParameter(String paramString) {
    		return (String) this.parameters.get(paramString);
    	}
    
    	
    	public AppletContext getAppletContext(){
    		return null;
    	}
    
    	
    	public void appletResize(int paramInt1, int paramInt2){
    	}
    }
    
    compiler, save as like compiler.bat:

    Code:
    @echo off
    Title Compiler
    "C:\Program Files\Java\jdk1.6.0_25\bin\javac.exe" *.java
    pause
    
    run, save as like run.bat:
    Code:
    @echo off
    title Client
    java -Xmx1000m Rs_Client 10 0 highmem members 32
    pause
    
    make a "Screenshot" folder.

    should be good to go. tl;dr

    www.sieuphan.com/download.html

    Credits:
    Me 50%
    wyn01 50%
     
  3. Unread #2 - Sep 5, 2012 at 6:28 AM
  4. iJava
    Joined:
    Nov 21, 2011
    Posts:
    1,197
    Referrals:
    11
    Sythe Gold:
    485
    Discord Unique ID:
    220055593568829441

    iJava .Previously known as RSGoldRush
    $200 USD Donor New

    Runescape Client

    I'd remove the porn link. I know where you got the source from though however you did modify it but you should give credits. Also why so many
    Code:
    this.variable
    You don't need to call this on every variable that you're using, only if it's the same as a param.
     
  5. Unread #3 - Sep 5, 2012 at 10:16 AM
  6. Sieu Phan
    Joined:
    Dec 16, 2011
    Posts:
    746
    Referrals:
    0
    Sythe Gold:
    0

    Sieu Phan Apprentice
    Banned

    Runescape Client

    Where was it from? I got the source from a friend lol. Tell me and ill credit it.

    edit: changed some naming, it had runeServer because I forgot to change it over to sythe, as I'm from rune-server :p
     
  7. Unread #4 - Sep 5, 2012 at 2:41 PM
  8. iJava
    Joined:
    Nov 21, 2011
    Posts:
    1,197
    Referrals:
    11
    Sythe Gold:
    485
    Discord Unique ID:
    220055593568829441

    iJava .Previously known as RSGoldRush
    $200 USD Donor New

    Runescape Client

    I believe wyn10 for villavu.
     
  9. Unread #5 - Sep 5, 2012 at 4:41 PM
  10. Sieu Phan
    Joined:
    Dec 16, 2011
    Posts:
    746
    Referrals:
    0
    Sythe Gold:
    0

    Sieu Phan Apprentice
    Banned

    Runescape Client

    My friend says he got it on tip.it or some runescape community site in like 2011, but added anyways
     
  11. Unread #6 - Sep 5, 2012 at 11:34 PM
  12. nodnarbusn
    Joined:
    Mar 12, 2012
    Posts:
    3,248
    Referrals:
    1
    Sythe Gold:
    214
    Sythe's 10th Anniversary Two Factor Authentication User Village Drunk Not sure if srs or just newfag... UWotM8?

    nodnarbusn Grand Master

    Runescape Client

    hahahahahhahah at the pornhub sythe and runescape all side by side ... that made my fucking day man!

    Seems pretty cool, get it verified and you will have more downloads, also consider putting a highscores look up option
     
  13. Unread #7 - Sep 6, 2012 at 12:07 AM
  14. Sieu Phan
    Joined:
    Dec 16, 2011
    Posts:
    746
    Referrals:
    0
    Sythe Gold:
    0

    Sieu Phan Apprentice
    Banned

    Runescape Client

    lol, if you read the code posted above, you can verify it yourself >.>
     
  15. Unread #8 - Oct 1, 2012 at 6:16 AM
  16. wyn10
    Joined:
    May 19, 2006
    Posts:
    106
    Referrals:
    0
    Sythe Gold:
    0

    wyn10 Active Member

    Runescape Client

    Correct.

    It's nice seeing people build on it though.
     
< Rsps | Need JAVA help >

Users viewing this thread
1 guest


 
 
Adblock breaks this site