Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1.     public void mouseOffScreen(){
  2.         final int millis = Random.nextInt(2000, 10000);
  3.         parent.setStatus("Antiban: Mouse off screen for "+millis+"ms");
  4.         int x;
  5.         int y;
  6.         Rectangle screen = Screen.getBounds();
  7.         if (Random.nextInt(10) > 5) {
  8.             x = Random.nextInt(screen.width);
  9.             if (Random.nextInt(10) > 5) {
  10.                 y = screen.getBounds().height+50;
  11.             }
  12.             else {
  13.                 y = -50;
  14.             }
  15.         }
  16.         else {
  17.             y = Random.nextInt(screen.height);
  18.             if (Random.nextInt(10) > 5) {
  19.                 x = screen.getBounds().width+50;
  20.             }
  21.             else {
  22.                 x = -50;
  23.             }
  24.         }
  25.         Mouse.move(new InteractablePoint(x,y));
  26.         Execution.delay(millis);
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement