Last active
July 7, 2022 08:29
-
-
Save avraampiperidis/3ac77c4ca29d502299172d7824ff474a to your computer and use it in GitHub Desktop.
MoveMouse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sample.testapi; | |
public class Main { | |
public static void main(String[] a) throws InterruptedException { | |
int x = 100; | |
int y = 100; | |
while (true) { | |
Thread.sleep(60000); | |
try { | |
java.awt.Robot robot = new java.awt.Robot(); | |
robot.mouseMove(x, y); | |
if(++x == 500 || ++y == 500) { | |
x = 100; | |
y = 100; | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Moves a mouse two pixels every one minute... for reasons