import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.Robot;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
public class ScreenSaverFucker {
public static final long SLEEP = 15000L;
public static final boolean DEBUG = true;
public static int COUNT ;
public static void main(String[] args) throws Exception {
Robot rbt = new Robot();
for(COUNT = 1 ; true ; COUNT++){
Point oldP = MouseInfo.getPointerInfo().getLocation();
int move = 1 - ((COUNT & 1) << 1);
System.out.println("COUNT:"+COUNT);
System.out.println("move"+move);
Point newP = new Point(oldP.x + move, oldP.y + move);
rbt.mouseMove(newP.x, newP.y);
if(DEBUG){
log(oldP, newP);
}
Thread.sleep(SLEEP);
}
}
public static void log(Point oldP, Point newP){
String str = "(" + oldP.x + "," + oldP.y +")" + "\t >" +
"(" + newP.x + "," +newP.y + ")";
DateFormat fmt = new SimpleDateFormat("[HH:mm:ss]");
String date = fmt.format(System.currentTimeMillis());
System.out.println(date + COUNT + "回目:\t" + str);
}
}