-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2k.py
More file actions
118 lines (103 loc) · 3.76 KB
/
2k.py
File metadata and controls
118 lines (103 loc) · 3.76 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
import time
# starting script
print "start"
# connection to the current device, and return a MonkeyDevice object
device = MonkeyRunner.waitForConnection()
count = 1
while (count < 100):
print "loop number: " + str(count)
#start event
print "entering into opponent selection"
device.touch(500, 1100, MonkeyDevice.DOWN_AND_UP)
time.sleep(5)
#choose opponent
print "choosing an opponent"
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
time.sleep(12)
#selecting attribute
print "choosing an attribute"
device.touch(910, 1800, MonkeyDevice.DOWN_AND_UP)
time.sleep(1)
#1st player
print "choosing 1st player"
device.touch(500, 1800, MonkeyDevice.DOWN_AND_UP)
print "rapid clicking"
for i in range(0, 10):
time.sleep(1)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
print "waiting"
time.sleep(2)
#2nd player
print "choosing 2nd player"
device.touch(800, 1800, MonkeyDevice.DOWN_AND_UP)
print "rapid clicking"
for i in range(0, 10):
time.sleep(1)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
print "waiting"
time.sleep(2)
#3rd player
print "choosing 3rd player"
device.touch(400, 1800, MonkeyDevice.DOWN_AND_UP)
print "rapid clicking"
for i in range(0, 10):
time.sleep(1)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
print "waiting"
time.sleep(2)
#4th player
print "choosing 4th player"
device.touch(700, 1800, MonkeyDevice.DOWN_AND_UP)
print "rapid clicking"
for i in range(0, 10):
time.sleep(1)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
print "waiting"
time.sleep(2)
#5th player
print "choosing 5th player"
device.touch(200, 1800, MonkeyDevice.DOWN_AND_UP)
print "rapid clicking"
for i in range(0, 10):
time.sleep(1)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1500, MonkeyDevice.DOWN_AND_UP)
print "waiting"
time.sleep(2)
#clicking prize cars
print "clicking cards"
for i in range(0, 100):
for j in range(20, 160):
device.touch(i*10, j*10, MonkeyDevice.DOWN_AND_UP)
time.sleep(1)
#proceed back to beginning
print "proceeding"
for i in range(0, 4):
time.sleep(1)
device.touch(500, 1800, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1800, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1800, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1800, MonkeyDevice.DOWN_AND_UP)
device.touch(500, 1800, MonkeyDevice.DOWN_AND_UP)
count +=1
print "end of script"