Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void mouseOffScreen(){
- final int millis = Random.nextInt(2000, 10000);
- parent.setStatus("Antiban: Mouse off screen for "+millis+"ms");
- int x;
- int y;
- Rectangle screen = Screen.getBounds();
- if (Random.nextInt(10) > 5) {
- x = Random.nextInt(screen.width);
- if (Random.nextInt(10) > 5) {
- y = screen.getBounds().height+50;
- }
- else {
- y = -50;
- }
- }
- else {
- y = Random.nextInt(screen.height);
- if (Random.nextInt(10) > 5) {
- x = screen.getBounds().width+50;
- }
- else {
- x = -50;
- }
- }
- Mouse.move(new InteractablePoint(x,y));
- Execution.delay(millis);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement