Robo007 at your Rescue – tech

August 26, 2008

Harly is back with a bang,

This time with something that you really need in certain situations.

Do ur screensaver annoy you, showing it after say x minutes of ur system being idle?

Do ur system ‘automatically locks’ after x minutes? As a result u r not able to download continuously!

Do ur bigB finds you are away , seeing ur monitor idle?

A quick easy solution, offcourse it seems you have already installed jdk on ur system..

Just run this piece of code,

import java.awt.AWTException;

import java.awt.Robot;

import java.awt.event.InputEvent;

import java.io.IOException;

public class Robo007 {

public static void main(String[] args) throws AWTException,IOException {

Robot rob = new Robot();

int count=0; int minutes=40; // works for 40 minutes. Change here as ur need

while(count < minutes) {

rob.mouseMove(1000,100); // arbitrary location

rob.delay(2000);

rob.mousePress(InputEvent.BUTTON1_MASK); //left click

rob.mouseRelease(InputEvent.BUTTON1_MASK);

rob.mouseMove(1100,250);

rob.mousePress(InputEvent.BUTTON1_MASK);

rob.mouseRelease(InputEvent.BUTTON1_MASK);

rob.delay(60000); // 1 minute delay

count++;

}

}

}

Run this code, and you are done with ur problem.

For Newbies:

Save the code in a file named Robo007.java. Save it in say D drive, inside a folder ‘max’

Open command prompt, set path=”the complete jdk path” ..say ‘set path=” D:\trojans\jdk1.5.0_06” ’

Then go the drive where the javafile is located using the command ,

D: [pls type this]

D:/ cd max [pls type this]

D:/max/>

Now, compile the javafile:

D:/max/ > javac Robo007.java [or use, javac –d <destination dir> <source dir> ]

You get the classfile Robo007.class in D:/max

Now Run the Class file using the command,

D:/max/ > java Robo007 [or java –cp . Roo007 ][Pls note space before & b/w -cp and dot]

That’s it, its launched J cheers J

Kudos to SunMicrosystems .

Entry Filed under: Uncategorized. Tags: , , , .

2 Comments Add your own

  • 1. Mosper  |  September 7, 2008 at 10:10 pm

    thanks a lot. It really works

    Reply
  • 2. Mosper  |  September 7, 2008 at 10:11 pm

    thanka a lot. it really worked.

    Reply

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


 

August 2008
S M T W T F S
« Jul   Sep »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Archives

Blogroll