Skip to content

Instantly share code, notes, and snippets.

@avraampiperidis
Last active July 7, 2022 08:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avraampiperidis/3ac77c4ca29d502299172d7824ff474a to your computer and use it in GitHub Desktop.
Save avraampiperidis/3ac77c4ca29d502299172d7824ff474a to your computer and use it in GitHub Desktop.
MoveMouse
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();
}
}
}
}
@avraampiperidis
Copy link
Author

Moves a mouse two pixels every one minute... for reasons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment