Screenshot Function Source

Discussion in 'Archives' started by Bladedaos, Jun 8, 2007.

Screenshot Function Source
  1. Unread #1 - Jun 8, 2007 at 11:02 PM
  2. Bladedaos
    Referrals:
    0

    Bladedaos Guest

    Screenshot Function Source

    We'll I was making backup of files and stumbled upon my old Runescape bot source. This is from about 2 years ago and I found a Screenshot function that was within the clients source. You could use this function to make runescape take a screenshot of itself.

    This may also work in the new Runescape, but I've heard it has some kind of protection against client modifications.

    Code:
    private void takeScreenShot() throws IOException {
            int picNumber = -1;
        
            File picsFolder = new File(".", "/ScreenShots/");
            if(!picsFolder.isDirectory() || !picsFolder.exists())
                picsFolder.mkdir();
            String directoryFiles[] = picsFolder.list();
            for(int i = 0; i < directoryFiles.length; i++) {
                try {
                    if(!directoryFiles[i].endsWith(".png") || directoryFiles[i].indexOf('$') != -1 || !directoryFiles[i].startsWith("Pic"))
                        continue;
                    int selectedPicNumber = Integer.parseInt(directoryFiles[i].substring(directoryFiles[i].indexOf("Pic") + 3, directoryFiles[i].indexOf(".png")));
                    if(selectedPicNumber > picNumber)
                        picNumber = selectedPicNumber;
                } catch(Exception e) {}
            }
            picNumber++;
    
            File picFile = new File("./Screenshots/", "Pic"+ picNumber +".png");
            BufferedImage picBufferedImage = new BufferedImage(512, 347, java.awt.image.BufferedImage.TYPE_INT_RGB);
            Graphics picGraphics = picBufferedImage.createGraphics();
            picGraphics.drawImage(dnb.bmb, 0, 0, this);
            picGraphics.dispose();
            ImageIO.write(picBufferedImage, "png", picFile);
            System.out.println("Screenshot written as: ./ScreenShots/Pic"+ picNumber +".png.");
        }
    Now this creates a folder named "ScreenShots" in your clients directory and saves your picture there in the .png format. This by itself is useless though as you need to have a trigger to activate it.

    Code:
            try
            {
            takeScreenShot();
            }
            catch (Exception e)
            {
            System.out.println("ScreenShot Error!");
            }
    Thats an example of a code that would trigger the function.
     
< Buying .... | Buying membership pin 900k >

Users viewing this thread
1 guest


 
 
Adblock breaks this site