-
Notifications
You must be signed in to change notification settings - Fork 32
/
云手机版_v2.0.txt
287 lines (253 loc) · 6.34 KB
/
云手机版_v2.0.txt
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
'云手机,适用分辨率设置: 720*1080
'作者NGA 阿尔斯·费尔斯通,代码参考自NGA Fitztech 模拟器代码
'房子坐标
Dim hx() ={180, 360, 540, 180, 360, 540, 180, 360, 540}
Dim hy() ={870, 760, 680, 690, 580, 500, 510, 400, 320}
'小火车坐标
Dim tx() ={430, 530, 630}
Dim ty() ={1100, 1040, 980}
Dim edit = {630, 780} '修建按钮坐标
Dim upgr = {600, 1200} '升级按钮坐标
Dim chan = {360, 1200} '替换按钮坐标
dim id=8 '指定升级建筑id,从左至右,从下到上依次为0~8
Function money() '收钱
For i=0 to 8
Tap hx(i), hy(i)
Delay 1000
Next
End Function
Function upgrade(id) '升级大哥
Tap edit(0), edit(1)
Delay 100
Tap hx(id), hy(id ) '大哥
Delay 500
Tap upgr(0), upgr(1)
Delay 300
Tap edit(0), edit(1)
Delay 100
End Function
Function loadtrain() '卸货
Dim ssx, ssy, sbx,sby,ax, ay, flag
flag = 0
For i = 0 To 2
// ssx = 1 '收所有
// 只收橙色,判断是否有紫色蓝色
FindColor tx(i)-50, ty(i) -100, tx(i), ty(i) - 50, "3CC1FF", 1, 1, ssx, ssy
FindColor tx(i)-50, ty(i)-100, tx(i), ty(i) -50, "EAC254|FF989A", 1, 1, sbx, sby
//只收橙色紫色,判断是否有蓝色
// FindColor tx(i)- 50, ty(i) -100, tx(i), ty( i)-50,"3CC1FF|FF989A",1,1, ssx, ssy
// FindColor tx(i)-50, ty(i)-100, tx(i), ty(i) -50, "EAC254", 1, 1, sbx, sby
If sbx > - 1 Then
flag = 1
end if
If ssx > - 1 Then
While True
TouchDown tx(i), ty(i)
Delay 500
FindColor 90, 170, 630, 870, "44E167|4AD566|7FFD8E", 1, 0.98, ax, ay
If ax > -1 and ay > -1 Then
TouchMove ax, ay
Delay 100
TouchUp
Delay 100
Else
TouchUp
Delay 100
Goto xx
End If
Wend
End If
Rem xx
Next
loadtrain = flag
End Function
Dim package = "com.tencent.jgm"
Function RestartGame() '重启游戏
TracePrint "重启游戏"
Delay 500
KillApp package
Delay 1000
RunApp package
Delay 5000
End Function
'凌晨重启-注意模拟器时间要与实际之间一致
Function MidNightRestart()
Dim hourNow = datetime.hour()
Dim minuteNow = datetime.minute()
If hourNow = 0 and minuteNow <= 3 Then
TracePrint "当前时间:",hourNow,"时",minuteNow,"分,重启家国梦"
RestartGame() '杀后台
End If
End Function
function strategy() '升级政策
tap 160, 160
delay 1000
while true
FindColor 80, 400, 430, 700, "03fe01|07fc07", 0, 0.98, stx, sty
if stx < 0 then
touchdown 360, 800
delay 500
touchmove 360, 480
delay 300
touchup
delay 500
else
delay 500
tap stx+100, sty+60
delay 1000
tap 360, 800
delay 500
tap 120, 1200
delay 500
tap 120, 1200
exit while
end if
wend
end function
function tomove() '更换建筑 用拖动 函数
TouchDown 360, 1100
Delay 500
TouchMove 360, 400
Delay 300
TouchUp
Delay 2000
end function
dim x
function tapchan(x) '更换建筑 用选择函数
tap 360, 500+x*300
delay 2000
tap 120, 1200
delay 2000
end function
function changehouse () '换成货物加成建筑
tap edit(0), edit(1)
delay 2000
tap hx(0), hy(0)-20
delay 1000
tap chan(0), chan(1)
delay 1000
tapchan(0)
tap hx(1), hy(1)-20
delay 1000
tap chan(0), chan(1)
delay 1000
tomove()
delay 500
tomove()
tapchan(1)
tap hx(2), hy(2)-20
delay 1000
tap chan(0), chan(1)
delay 1000
tomove()
tomove()
tapchan(2)
tap hx(3), hy(3)-20
delay 1000
tap chan(0), chan(1)
delay 1000
tapchan(2)
tap hx(6), hy(6)-20
delay 1000
tap chan(0), chan(1)
delay 1000
tomove()
tomove()
tapchan(2)
tap edit(0), edit(1)
delay 2000
end function
function rebackhouse() '收货结束,回复建筑
tap edit(0), edit(1)
delay 2000
tap hx(0), hy(0)-20
delay 1000
tap chan(0), chan(1)
delay 1000
tapchan(2)
tap hx(1), hy(1)-20
delay 1000
tap chan(0), chan(1)
delay 1000
tomove()
tapchan(1)
tap hx(2), hy(2)-20
delay 1000
tap chan(0), chan(1)
delay 1000
tomove()
tomove()
tapchan(2)
tap hx(3), hy(3)-20
delay 1000
tap chan(0), chan(1)
delay 1000
tapchan(1)
tap hx(6), hy(6)-20
delay 1000
tap chan(0), chan(1)
delay 1000
tapchan(1)
tap edit(0), edit(1)
delay 2000
end function
function loadtime() '收货模式
changehouse()
While True
Dim m=1, n = 1
Dim iter = 120
While n < iter
Dim res
Dim cx1, cy1
delay 1000
FindColor 180, 120, 240, 180, "00d900" , 0, 0.98, stx, sty
if stx > -1 then
strategy()
end if
FindColor tx(0)-50, ty(0)-100, tx(0), ty(0) -50, "EAC254|FF989A|3CC1FF", 1, 1, cx1, cy1
If cx1<0 And cy1< 0 Then
m=m+1
If n = iter - 1 Then
tap 120, 1200 '增加容错率,防止 弹出 通知 卡死
money ()'收钱,注释掉此行后不进行收钱
upgrade (id) '升级建筑,注释掉此行后不进行升级
Else
Delay 1000
End If
Else
res = loadtrain() '卸货
If res = 1 Then
RestartGame() '重新登陆
End If
End If
n = n + 1
Wend
if m=119 then '连续2分钟无火车,退出收货模式
exit while
end if
Wend
rebackhouse()
End Function
'主程序
Dim cx, cy, stx, sty, t =1, iter=120
while true
MidNightRestart()
delay 1000
FindColor 180, 120, 240, 180, "00d900" , 0, 0.98, stx, sty
if stx > -1 then
strategy()
end if
FindColor tx(0)-50, ty(0)-100, tx(0), ty(0) -50, "EAC254|FF989A|3CC1FF", 1, 1, cx, cy
If cx<0 And cy< 0 Then
if t=iter- 1 then
tap 120, 1200 '增加容错率,防止 弹出 通知 卡死
money()
upgrade(id)
else
delay 1000
end if
else
loadtime()
end if
t=t+ 1
wend