-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetGoldCoinAutoLow.py
More file actions
79 lines (59 loc) · 1.65 KB
/
Copy pathgetGoldCoinAutoLow.py
File metadata and controls
79 lines (59 loc) · 1.65 KB
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
# coding: utf-8
#
import os
import logging
from random import uniform
from time import sleep
device_x, device_y = 1920, 1080
logging.basicConfig(format='%(asctime)s %(message)s',
datefmt='%m/%d/%Y %I:%M:%S %p',
level=logging.DEBUG)
def tap_screen(pos):
base_x, base_y = 1920, 1080
x = int(float(pos[0]) / base_x * device_x + uniform(0, 10) - 5)
y = int(float(pos[1]) / base_y * device_y + uniform(0, 10) - 5)
os.system("adb shell input tap {} {}".format(x, y))
autoPos = [1780, 40]
skipPos = [1720, 80]
againPos = [1600, 980]
startPos = [1600, 970]
continuePos = [960, 540]
def work(times):
logging.debug('第1次刷副本...')
logging.debug('点击闯关按钮...')
tap_screen(startPos)
sleep(10)
logging.debug('点击跳过按钮...')
tap_screen(skipPos)
sleep(67)
logging.debug('点击跳过按钮...')
tap_screen(skipPos)
sleep(9)
logging.debug('点击跳过按钮...')
tap_screen(skipPos)
sleep(5)
logging.debug('点击任意处继续...')
tap_screen(continuePos)
sleep(2)
for i in xrange(1, times):
logging.debug('第{}次刷副本...'.format(i+1))
logging.debug('点击再次挑战按钮...')
tap_screen(againPos)
sleep(3)
logging.debug('点击闯关按钮...')
tap_screen(startPos)
sleep(10)
logging.debug('点击跳过按钮...')
tap_screen(skipPos)
sleep(67)
logging.debug('点击跳过按钮...')
tap_screen(skipPos)
sleep(9)
logging.debug('点击跳过按钮...')
tap_screen(skipPos)
sleep(5)
logging.debug('点击任意处继续...')
tap_screen(continuePos)
sleep(2)
if __name__ == '__main__':
work(120)