-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
65 lines (53 loc) · 1.27 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const express = require('express');
const app = express();
var robot = require("robotjs");
var mouse = robot.getMousePos();
var ip = require("ip");
console.log ( ip.address() );
// 192.168.29.84:3000
app.set('view engine', 'ejs');
app.get('/',(req,res)=>{
res.render('q.ejs')
})
app.get('/order',(req,res)=>{
const {start} = req.query
robot.moveMouse(19, 696);
robot.mouseClick();
// res.send(
// `<h1>incoming request</h1>`
// )
})
app.get('/up',(req,res)=>{
const {start} = req.query
var m = robot.getMousePos();
robot.moveMouse(m.x, m.y-50);
})
app.get('/down',(req,res)=>{
const {start} = req.query
var m = robot.getMousePos();
robot.moveMouse(m.x, m.y+50);
})
app.get('/left',(req,res)=>{
const {start} = req.query
var m = robot.getMousePos();
robot.moveMouse(m.x-50, m.y);
})
app.get('/right',(req,res)=>{
const {start} = req.query
var m = robot.getMousePos();
robot.moveMouse(m.x+50, m.y);
})
app.get('/click',(req,res)=>{
const {start} = req.query
robot.mouseClick();
})
app.get('/bounce',(req,res)=>{
res.render('boumce.ejs')
})
app.get('/hi',(req,res)=>{
res.render('hi.ejs')
})
app.listen(3000,()=>{
console.log('listening')
});
console.log(mouse)