This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path购买车厢.js
87 lines (87 loc) · 5.74 KB
/
购买车厢.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
76
77
78
79
80
81
82
83
84
85
86
87
var swipeInterval=50;
run();
function run (){
var i=1;
toast ("第"+i+"次运行开始");
clickBuyCar();
clickBuyCar();
clickBuyCar();
clickBuyCar();
clickBuyCar();
gatherMap();
toast ("第"+i+"次运行结束");
i++;
setInterval(()=>{
toast ("第"+i+"次运行开始");
clickBuyCar();
clickBuyCar();
clickBuyCar();
clickBuyCar();
clickBuyCar();
gatherMap();
toast ("第"+i+"次运行结束");
i++;
},10000)
}
function clickBuyCar(){
return click(device.width/2,device.height/10*9);
}
function getCarPos(x,y){
/**x[1-5] y[1-2] */
var x_pos=device.width/10*(x*2-1);
var y_pos=device.height/20*((y==1?14:16));
return [x_pos,y_pos];
}
function gatherCars(car1,car2){
/**car1=[x,y] */
swipe(car1[0], car1[1], car2[0], car2[1], swipeInterval);
/*SVGPathSegClosePath(swipeInterval)*/
}
function gatherMap(){
gatherCars(getCarPos(1,1),getCarPos(1,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(1,1),getCarPos(2,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(1,1),getCarPos(2,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(1,1),getCarPos(3,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(1,1),getCarPos(3,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(1,1),getCarPos(4,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(1,1),getCarPos(4,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(1,1),getCarPos(5,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(1,1),getCarPos(5,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(2,1),getCarPos(1,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(2,1),getCarPos(1,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(2,1),getCarPos(2,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(2,1),getCarPos(3,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(2,1),getCarPos(3,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(2,1),getCarPos(4,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(2,1),getCarPos(4,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(2,1),getCarPos(5,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(2,1),getCarPos(5,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(3,1),getCarPos(1,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(3,1),getCarPos(1,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(3,1),getCarPos(2,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(3,1),getCarPos(2,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(3,1),getCarPos(3,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(3,1),getCarPos(4,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(3,1),getCarPos(4,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(3,1),getCarPos(5,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(3,1),getCarPos(5,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(4,1),getCarPos(1,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(4,1),getCarPos(1,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(4,1),getCarPos(2,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(4,1),getCarPos(2,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(4,1),getCarPos(3,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(4,1),getCarPos(3,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(4,1),getCarPos(4,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(4,1),getCarPos(5,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(4,1),getCarPos(5,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(5,1),getCarPos(1,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(5,1),getCarPos(1,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(5,1),getCarPos(2,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(5,1),getCarPos(2,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(5,1),getCarPos(3,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(5,1),getCarPos(3,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(5,1),getCarPos(4,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(5,1),getCarPos(4,1));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
gatherCars(getCarPos(5,1),getCarPos(5,2));sleep(swipeInterval);handleAlertBox();sleep(swipeInterval);
}
function handleAlertBox(){}