-
Notifications
You must be signed in to change notification settings - Fork 136
/
out_of_control.java
23 lines (20 loc) · 776 Bytes
/
out_of_control.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Developer: Minhas Kamal
// Randomly moves the mouse pointer, & clicks different places on the screen.
import java.awt.Robot;
import java.awt.event.InputEvent;
import java.util.Random;
public class out_of_control {
public static void main(String[] args) throws Exception {
Robot robot = new Robot();
Random random = new Random();
while(true){
robot.mouseMove(random.nextInt(1200), random.nextInt(700));
//click(robot); // don't un-comment, may cause harm.
Thread.sleep(300);
}
}
private static void click(Robot robot){
robot.mousePress(InputEvent.BUTTON1_MASK);robot.mouseRelease(InputEvent.BUTTON1_MASK);
robot.mousePress(InputEvent.BUTTON1_MASK);robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
}