작성일 : 16-12-01 16:38
java mouse control
 글쓴이 : 조희승
조회 : 175  
import java.awt.event.*;
import java.awt.Robot;
public class a {
public static void main(String args[]) {
Robot bot = null;
try {
bot = new Robot();
} catch (Exception failed) {
System.err.println("Failed instantiating Robot: " + failed);
}
int mask = InputEvent.BUTTON1_DOWN_MASK;

for (int i=0; i< 600; i++)
{


bot.mouseMove(910, 730);
bot.mousePress(mask);
bot.mouseRelease(mask);

try {
Thread.sleep(1*1000);
} catch (InterruptedException e) { }

bot.mouseMove(910, 730);
bot.mousePress(mask);
bot.mouseRelease(mask);
try {
Thread.sleep(1*1000);
} catch (InterruptedException e) { }


bot.mouseMove(550, 480);
bot.mousePress(mask);
bot.mouseRelease(mask);

try {
Thread.sleep(60*1000);
} catch (InterruptedException e) { }

System.out.println (i);




}














}
}