-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathunlimited_pool.js
59 lines (48 loc) · 1.21 KB
/
unlimited_pool.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
auto()
if (!requestScreenCapture(true)) {
toast('请求截图失败')
exit()
}
sleep(300)
var utils = require('./utils')
var findButton = utils.findButton
var readImage = utils.readImage
var click1 = utils.click
var sleep1 = utils.sleep
var Blank = [2016, 821]
// setScreenMetrics(1080, 2340)
var UnlimitedBtn = readImage('./assets/unlimited/10.jpg')
var Zero = readImage('./assets/unlimited/zero.jpg')
// 重置无限池
var Reset = readImage('./assets/unlimited/reset.jpg')
var Execute = [1582, 861]
var Close = [1268, 840]
var i = 0
events.on('exit', function() {
UnlimitedBtn.recycle()
Zero.recycle()
Reset.recycle()
toast('共抽 ' + i + ' 次')
})
toast('开抽')
while (true) {
if (findButton(Reset, { maxTimes: 1 })) {
toast('已经空拉,重置开始')
const resetPosition = findButton(Reset, { maxTimes: 1 })
if (!resetPosition) {
continue
}
click1(resetPosition[0], resetPosition[1], false)
sleep1(500)
click1(Execute[0], Execute[1], true)
sleep(4000)
click1(Close[0], Close[1], true)
sleep(1000)
}
const position = findButton(UnlimitedBtn, { maxTimes: 5 })
if (position) {
click1(position[0], position[1], false)
i++
}
sleep1(300)
}