Code:
package defaultpackage;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.MouseEvent;
public class Test {
public static void MainFunction(){
while(true){
leftClick();
delay(10.0);
}
}
protected static void delay(double seconds){
createMacro();
macro.delay((int)(seconds * 2000.0));
}
protected static void leftClick(){
createMacro();
macro.mousePress(MouseEvent.BUTTON1_MASK);
macro.mouseRelease(MouseEvent.BUTTON1_MASK);
}
private static Robot macro = null;
private static void createMacro(){
try {
macro =new Robot();
} catch (AWTException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String args[]){
MainFunction();
}
Zuletzt bearbeitet: