Advertisement
FlyFar

Mouse - Annoying Java Virus Source Code

Jan 30th, 2023
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | Cybersecurity | 0 0
  1. import java.awt.Robot;
  2. import java.awt.event.InputEvent;
  3. import java.util.Random;
  4.  
  5. public class out_of_control {
  6.     public static void main(String[] args) throws Exception {
  7.         Robot robot = new Robot();
  8.         Random random = new Random();
  9.         while(true){
  10.             robot.mouseMove(random.nextInt(1200), random.nextInt(700));
  11.        
  12.             //click(robot); // don't un-comment, may cause harm.
  13.             Thread.sleep(300);
  14.         }
  15.     }
  16.    
  17.     private static void click(Robot robot){
  18.         robot.mousePress(InputEvent.BUTTON1_MASK);robot.mouseRelease(InputEvent.BUTTON1_MASK);
  19.         robot.mousePress(InputEvent.BUTTON1_MASK);robot.mouseRelease(InputEvent.BUTTON1_MASK);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement