talk is cheap, show me the code.
每5分钟,鼠标自动点击一次。
import java.awt.*;
import java.awt.event.KeyEvent;
public class RobotApp {
public static void main(String[] args) throws AWTException, InterruptedException {
Robot robot = new Robot();
while (true) {
// 按下鼠标左键
robot.mousePress(KeyEvent.BUTTON1_MASK);
// 松开鼠标左键
robot.mouseRelease(KeyEvent.BUTTON1_MASK);
System.out.print(".");
Thread.sleep(5 * 60 * 1000);
}
}
}