挂机游玩具外挂源码-帮助了解nodejs的几个开源库

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);

}

});

你可能感兴趣的:(挂机游玩具外挂源码-帮助了解nodejs的几个开源库)