-
Notifications
You must be signed in to change notification settings - Fork 126
/
pdd.js
75 lines (59 loc) · 1.85 KB
/
pdd.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
66
67
68
69
70
71
72
73
74
75
/*
拼多多 多多精灵 每晚20点 钻石秒杀脚本 (本人已经成功秒杀多次)
使用方法
打开拼多多活动界面,一堆精灵的菜园子那个
在19点59分50秒启动本脚本,然后全程不用管了
(在代码第50行双引号内预先填入商品名字)
可以根据自己实际情况调整第45行阈值,你手机加载越快值越大且<1000
*/
auto.waitFor();
auto.setMode("fast");
setScreenMetrics(device.width,device.height);
console.show();
var h = 0,
m = 0,
s = 8;
ss = 0;
while (true) {
var myDate = new Date();
console.log("当前 : %d 。", myDate.getSeconds());
if (myDate.getHours() >= h &&
myDate.getMinutes() >= m &&
myDate.getSeconds() % 10 >= s &&
myDate.getMilliseconds() >= ss)
break;
}
var myDate = new Date();
console.log("加载拼多多 : %d 。", myDate.getSeconds());
launch("com.xunmeng.pinduoduo");
var myDate = new Date();
console.log("进入界面 : %d 。", myDate.getSeconds());
var next = text("立即兑换").findOne();
console.log(next.text());
while (true) {
var myDate = new Date();
console.log(myDate.getSeconds() + ":" +
myDate.getMilliseconds());
if (myDate.getSeconds() % 10 == 9 &&
myDate.getMilliseconds() > 600)
break;
}
next.click();
var goods = textContains("惠百施牙刷2支").findOne();
console.log("找到%s", goods.text());
click(goods.bounds().centerX(), goods.bounds().centerY());
var confirm = text("确认兑换").findOne();
confirm.click();
console.log(confirm);
console.log("点击 确认 成功");
sleep(250);
while (true)
click(700, 1850);
/*
console.log("等待地址加载...");
var address = text("川建国").findOne();
console.log(address);
click(address.bounds().centerX(), address.bounds().centerY());
var myDate = new Date();
console.log("抢购成功 : %d 。", myDate.getSeconds());
*/