java simulate click

Playing a game called hero clicker on steam, to put it bluntly, is to fight monsters by clicking with the mouse. So witty, I decided to build a program to automatically click (successfully completed the mourning achievement of 35 clicks per second [#Manual Funny]).

The java.awt.Robot class is the core. This class can simulate mouse clicks, scrolling, and movement; simulate keyboard input, capture screen images, and so on.

Robot robot=new Robot();
robot.mouseMove(1000,400);
robot.delay(100);



while(true){
    robot.mousePress( InputEvent.BUTTON1_MASK );
    robot.mousePress( InputEvent.BUTTON1_MASK );
    robot.delay(100);
}

I decided to use this as a starting point to write a generic screen auto-click application.
In addition, the Robot class can take screenshots, and can also obtain the color of specified pixels on the screen. These functions can be used to do great things. . .

http://blog.csdn.net/clong2015/article/details/52806650
http://jingyan.baidu.com/article/fc07f9891b336312ffe51900.html
These two introductions about the Robot class are okay

Guess you like

Origin blog.csdn.net/qq_34507736/article/details/54768763
Recommended