var robot = require("robotjs");
var later = require("later");
var keypress = require('keypress');
later.date.localTime();
console.log("Now:"+new Date());
setInterval(function(){
var mouse = robot.getMousePos();
console.log('x:'+mouse.x + " y:"+mouse.y);
var x = 1503;
var y = 946;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1353;
var y = 434;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1495;
var y = 435;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1620;
var y = 436;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1478;
var y = 274;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1492;
var y = 601;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1659;
var y = 335;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1397;
var y = 353;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
},400);
setInterval(function(){
var mouse = robot.getMousePos();
var x = 1406;
var y = 990;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1724;
var y = 721;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1745;
var y = 625;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1728;
var y = 811;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
var x = 1728;
var y = 892;
robot.moveMouse(x, y);
robot.mouseClick("left");
var mouse = robot.getMousePos();
},4000);
keypress(process.stdin);
process.stdin.on('keypress', function (ch, key) {
console.log('got "keypress"', key);
if(key == 'd'){
clearInterval(timerxxx);
}
});