-
Notifications
You must be signed in to change notification settings - Fork 42
/
path.lua
7655 lines (6915 loc) · 250 KB
/
path.lua
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
path = {}
-- base 只在跳转时使用,如果在任务中间需要登录失效,则当前任务超时后,下一任务的跳转会重新登录。
-- base 应覆盖尽可能多的corner case。
-- wait_game_up 每5秒执行一次,保证游戏在前台,别点到其他应用。
-- wait_game_up 有必要在游戏中自动亮屏吗:有
-- wait_game_up 有必要在切出游戏后回到游戏吗:有
-- wait_game_up 有必要做B服界面跳转吗:没有。做了之后,退出账号难实现
path.base = {
面板 = function()
login_error_times = 0
return true
end,
下载资源确认 = "下载资源确认",
资源下载确定 = "资源下载确定",
start黄框 = function()
-- reset login history on app restart
login_times = 0
table.remove(login_time_history or {})
wait(function()
tap("适龄提示")
tap("保持配音")
tap("保持配音确定")
tap("start黄框")
end)
end,
start黄框暗 = function() return path.base["start黄框"]() end,
账号登录 = function() tap("账号登录") end,
开始唤醒 = function()
if log_login_to_cloud == true then
cloud.addLog("INFO", "开始登录", "正在尝试登录", "")
end
check_login_frequency()
wait(function()
tap("开始唤醒")
disappear("开始唤醒")
end, 5)
end,
手机验证码登录 = disable_game_up_check_wrapper(function()
if appid ~= oppid then return end
if log_login_to_cloud == true then
cloud.addLog("INFO", "开始登录", "正在尝试登录", "")
end
if not username or #username == 0 or not password or #password == 0 then
-- 单账号直接停,多账号跳过
stop("账号或密码为空", account_idx and 'next' or '')
end
if #username > 0 then
log(44)
if not wait(function()
tap("账号左侧")
tap("账号")
if appear('inputbox', 1) then return true end
end, 10) then
return
end
log(45)
if not wait(function()
wait(function() input("inputbox", username) end, 1)
log(45.1)
tap("okbutton")
-- appear("手机验证码登录")
if appear("手机验证码登录", 1) and not findOne("okbutton") then
return true
end
log(45.2)
end, 3) then
return
end
log(46)
end
if not appear("手机验证码登录", 1) then return end
if #password > 0 then
log(44)
if not wait(function()
tap("账号左侧")
tap("密码")
-- if disappear("手机验证码登录", 1) then return true end
if appear('inputbox', 1) then return true end
end, 10) then
return
end
log(45)
-- if not appear('inputbox') then return end
-- ssleep(1) -- 等待输入法弹出
-- ssleep(.5) -- 等待输入法弹出
if not wait(function()
wait(function() input("inputbox", password) end, 1)
log(45.1)
tap("okbutton")
-- appear("手机验证码登录")
if appear("手机验证码登录", 1) and not findOne("okbutton") then
return true
end
log(45.2)
end, 3) then
return
end
log(46)
-- appear("手机验证码登录")
end
log(47)
if not appear("手机验证码登录", 1) then return end
log(48)
-- local login_error_times = 0
wait(function(reset_wait_start_time)
tap("登录")
local p = appear({
"captcha", "密码不能为空", "单选确认框", "注册协议",
}, 2)
log(p)
if p == "注册协议" then return true end
if p == 'captcha' then
trySolveCapture()
appear("单选确认框")
end
if p == "密码不能为空" or p == "单选确认框" then
return true
end
end, 4)
if findTap("单选确认框") then
log("login_error_times", login_error_times)
login_error_times = (login_error_times or 0) + 1
end
-- 两次,第一次可能是数据更新
if login_error_times > 1 then
stop("单选确认框,密码错误?", account_idx and 'next' or '')
end
if log_login_to_cloud == true then
cloud.addLog("INFO", "登录成功", "已成功登录至游戏", "")
end
end),
正在释放神经递质 = function()
if not disappear("正在释放神经递质", 1800, 1) then
stop("正在释放神经递质超半小时", 'cur')
end
end,
接管作战 = function()
-- 开始计时
fight_start_time = fight_start_time or time()
local elapsed = time() - fight_start_time
local fight_type = get_fight_type(cur_fight)
-- 一般10分钟,剿灭40分钟
local fight_timeout = (table.includes({ "剿灭" }, fight_type) and elapsed >
40 * 60 * 1000) or
(not table.includes({ "剿灭" }, fight_type) and
elapsed > 10 * 60 * 1000)
-- 超时跳过当前关
if fight_timeout then
local info = table.join(qqmessage, ' ') .. " [" .. cur_fight ..
"] 代理超时"
captureqqimagedeliver("WARN", "代理超时", info, true)
fight_start_time = nil
clean_fight(cur_fight)
restartapp(appid)
return
end
-- 超时5分钟后重启游戏
if not wait(function()
if not findOne("接管作战") then return true end
-- log(126)
if findOne("暂停中") and not disappear("暂停中", 5) then
tap("开包skip")
disappear("暂停中")
end
end, 5 * 60) then
return restartapp(appid)
end
-- log(127)
-- if not disappear("接管作战", 8 * 60 * 60, 1) then
-- stop("接管作战超8小时")
-- end
-- this calllback only works for 主线、资源、剿灭
local unfinished
local first_time_see_zero_star
local zero_star
local see_end
local see_jm_record_change
local unexpect_return
local home
local normal
if not wait(disable_log_wrapper(function()
if findOne("行动结束") then see_end = true end
if findOne("行动结束") and findOne("零星代理") then
first_time_see_zero_star = first_time_see_zero_star or time()
-- 实测560秒,给两倍
if time() - first_time_see_zero_star > 1200 then zero_star = true end
end
if findOne("开始行动") and findOne("代理指挥开") then
log(59)
normal = true
return true
end
if findOne("接管作战") then
unfinished = true
return true
end
if findOne("剿灭接管作战") and
not disappear("剿灭接管作战", 5) then
captureqqimagedeliver("INFO", "剿灭作战",
table.join(qqmessage, ' ') .. " [" .. cur_fight ..
"]剿灭接管作战", true)
tap("剿灭接管作战")
ssleep(2)
tap("面板设置", true)
ssleep(2)
tap("剿灭放弃行动")
-- ssleep(2)
-- tap("右确认")
appear("剿灭记录确认", 60)
end
if findOne("剿灭记录确认") and
not disappear("剿灭记录确认", 5) then
captureqqimagedeliver("INFO", "剿灭作战",
table.join(qqmessage, ' ') .. " [" .. cur_fight ..
"]剿灭记录确认", true)
tap("剿灭记录确认")
see_jm_record_change = true
end
-- 战斗记录未同步
if findOne("返回确认界面") and
not disappear("返回确认界面", 5) then
tap("左取消")
unexpect_return = true
end
-- 掉线
if findAny({
"开始唤醒", "bilibili_framelayout_only", "framelayout_only",
"手机验证码登录",
}) then
home = true
log(60)
return true
end
tap("开始行动1")
appear({ "开始行动", "接管作战" }, 1)
end), 60) then
-- if findOne("跳过剧情2") and not disappear("跳过剧情2", 10) then
path.跳过剧情()
-- end
return
end
if unfinished then return path.base.接管作战() end
-- 清除计时
fight_start_time = nil
log("回到首页")
log("代理结束", cur_fight, "失败次数", fight_failed_times[cur_fight])
log(139, first_time_see_zero_star, zero_star)
log("zero_star", zero_star)
log("see_end", see_end)
log("home", home)
log("normal", normal)
if zero_star or not see_end or home then
log("代理失败返回首页")
if not qqnotify_nofailedfight then
local info = table.join(qqmessage, ' ') .. " [" .. cur_fight ..
"] 代理失败" .. (home and "(掉线或抢登)" or '')
-- (zero_star and 'zero_star' or '') ..
-- (see_end and 'see_end' or '') ..
-- (normal and 'normal' or '')
captureqqimagedeliver("WARN", "代理失败", info, true)
end
-- 一次代理失败直接认为无效:不行,因为可能是掉线造成的失败
fight_failed_times[cur_fight] = max(0, fight_failed_times[cur_fight] or 0)
log(161)
return path.跳转("首页")
end
if see_jm_record_change then
fight_failed_times[cur_fight] = 99
return path.跳转("首页")
end
table.insert(fight_history, cur_fight)
fight_times = (fight_times or 0) + 1
if fight_times >= max_fight_times then
fight_times = 0
restartapp(appid)
return path.跳转("首页")
end
log(89, repeat_fight_mode)
if repeat_fight_mode then return path.开始游戏('') end
-- current fight success
pre_fight = cur_fight
fight_failed_times[cur_fight] = -3
-- if same fight or same page fight
local next_fight_tick = fight_tick % #fight + 1
local next_fight = fight[next_fight_tick]
log(cur_fight, next_fight)
if table.includes({ "剿灭" }, get_fight_type(cur_fight)) then
jmfight_times = (jmfight_times or 0) + 1
if jmfight_times >= max_jmfight_times then clean_jmfight() end
-- if appear("全权委托", 1) then
-- wait(function()
-- tap("全权委托")
-- if disappear("全权委托", 1) and not disappear("开始行动", 1) then
-- return true
-- end
-- end, 30)
-- end
-- 剿灭必须回主页
-- if not appear("主页") then back() end
return path.跳转("首页")
elseif next_fight == cur_fight then
fight_tick = next_fight_tick
pre_fight = nil
if not request_memory_clean() then
return path.开始游戏(next_fight)
else
return path.跳转("首页")
end
elseif same_page_fight(cur_fight, next_fight) then
if not wait(function()
if not findOne("开始行动") then return true end
tap("主页右侧")
end, 20) then
return
end
-- TODO how to ignore this sleep
-- ssleep(.5)
-- 只有主线与物资芯片会存在same_page_fight,
-- 物资芯片的appear是完备的
local x = get_fight_type(cur_fight)
-- if x == "物资芯片" then
-- appear("作战列表" .. cur_fight, .5)
if x == "主线" then
local x0 = cur_fight
local chapter = x0:find("-")
chapter = x0:sub(1, chapter - 1)
chapter = chapter:sub(chapter:find("%d"))
local chapter_index = tonumber(chapter) + 1
appear("当前进度列表" .. chapter_index, .5)
else
log("unexpected same page fight wait")
ssleep(.5)
end
end
end,
bilibili_framelayout_only = function()
if log_login_to_cloud == true then
cloud.addLog("INFO", "开始登录", "正在尝试登录", "")
end
auto(path.bilibili_login, nil, 0, default_auto_timeout_second, true)
if log_login_to_cloud == true then
cloud.addLog("INFO", "登录成功", "已成功登录至游戏", "")
end
if new_change_account_plan then 快速切号功能状态 = false end
end,
framelayout_only = function()
if log_login_to_cloud == true then
cloud.addLog("INFO", "开始登录", "正在尝试登录", "")
end
auto(path.login, nil, 0, default_auto_timeout_second, true)
if log_login_to_cloud == true then
cloud.addLog("INFO", "登录成功", "已成功登录至游戏", "")
end
if new_change_account_plan then 快速切号功能状态 = false end
end,
}
path.bilibili_login = {
b服年度报告 = function()
tap("b服年度报告")
ssleep(0.5)
tap("b服年度报告关闭")
end,
同意协议 = function() return path.fallback.同意协议() end,
活动公告返回 = function() return path.fallback.活动公告返回() end,
同意并继续 = function()
local p = findNode(point["同意并继续"])
if p then
clickNodeFalse(p)
disappear("同意并继续")
end
end,
captcha = function() trySolveCapture() end,
bgame = true,
bilibili_license_ok = function() tap("bilibili_license_ok") end,
bilibili_phone_inputbox = function()
-- 把输入法关了
wait(function()
if findOne("bilibili_account_login") then return true end
tap("返回")
end, 5)
local tos = findOne("bilibili_tos")
if tos then tap({ tos.bounds.l + scale(5), tos.bounds.t + scale(5) }) end
tap("bilibili_account_login")
appear("bilibili_username_inputbox")
end,
-- bilibili_username_inputbox = function()
-- if not findOne()
-- tap("返回")
-- end,
bilibili_username_inputbox = disable_game_up_check_wrapper(function()
log(149)
-- 把输入法关了
wait(function()
if findOne("bilibili_login") then return true end
tap("返回")
end, 5)
if username and #username > 0 and password and #password > 0 then
wait(function() input("bilibili_username_inputbox", username) end, 1)
wait(function() input("bilibili_password_inputbox", password) end, 1)
-- input("bilibili_username_inputbox", username)
-- input("bilibili_password_inputbox", password)
else
stop("账号或密码为空", account_idx and 'next' or '')
end
tap("bilibili_login")
disappear("bilibili_login", 15)
tap("bilibili_login")
disappear("bilibili_login", 5)
login_error_times = (login_error_times or 0) + 1
if login_error_times > 2 then
-- if not appear({"bilibili_change2", "captcha", {text = "存储"}}, 15) then
stop("B服登录密码错误或设备数量超限",
account_idx and 'next' or '')
end
-- 小米
-- appearTap({text = "存储"}, 1)
appear({
"bilibili_change2", "captcha", "B服安全验证",
"B服安全验证320DPI",
})
end),
bilibili_oneclicklogin = function()
tap("bilibili_oneclicklogin")
appear({ "bilibili_ok", "bilibili_change2" }, 5)
end,
bilibili_ok = function()
tap("bilibili_ok")
appear("bgame", 5)
end,
bilibili_other = function()
tap("bilibili_other")
appear("bilibili_phone_inputbox")
end,
bilibili_change2 = function()
check_login_frequency()
disappear("bilibili_change2", 10)
log(271)
end,
B服安全验证320DPI = function()
return path.bilibili_login.B服安全验证()
end,
B服安全验证 = disable_game_up_check_wrapper(function()
log("等待加载出图")
if not appear({ "B服安全验证提交", "B服安全验证提交320DPI" }, 5) then
log("等待节点识别加载失败")
if not checkPointColor({ 823, 605, "BAD9FF" }) then
log("等待720p图色识别加载失败")
return
end
end
if #strOr(captcha_username) == 0 or #strOr(captcha_password) == 0 then
stop("B服安全验证需要图鉴账密", account_idx and 'next' or '')
end
local box = findOne("B服安全验证框")
log("box", box)
if not box then return end
box = box.bounds
bilibili_captcha_times = (bilibili_captcha_times or 0) + 1
if bilibili_captcha_times > 5 then
stop("B服安全验证5次失败", account_idx and 'next' or '')
end
ssleep(.5)
log("使用云控打码")
if cloud.captcha() then
if not findTap("B服安全验证提交") then
findTap("B服安全验证提交320DPI")
tapIfCheckedColor({ 823, 605, "539FFE" }, { 823, 605, "539FFE" })
end
if appear({ "B服安全验证失败", "B服安全验证失败320DPI" }) then
cloud.captcha_report()
ssleep(2.0)
log("使用图鉴打码")
if trySolvePointSelectionCapture(captcha_username, captcha_password, box) then
if not findTap("B服安全验证提交") then
findTap("B服安全验证提交320DPI")
tapIfCheckedColor({ 823, 605, "539FFE" }, { 823, 605, "539FFE" })
end
if appear({ "B服安全验证失败", "B服安全验证失败320DPI" }) then
ttshitu_report()
ssleep(1.0)
back()
end
-- wait(function()
-- if not findAny({
-- "B服安全验证提交", "B服安全验证提交320DPI",
-- }) then
-- return true
-- end
-- ssleep(2)
-- back()
-- end, 5)
end
end
if wait(function()
if not findAny({
"B服安全验证提交", "B服安全验证提交320DPI",
}) then
return true
end
ssleep(2)
back()
end, 5) then
return
end
else
log("使用图鉴打码")
if trySolvePointSelectionCapture(captcha_username, captcha_password, box) then
if not findTap("B服安全验证提交") then
findTap("B服安全验证提交320DPI")
tapIfCheckedColor({ 823, 605, "539FFE" }, { 823, 605, "539FFE" })
end
if appear({ "B服安全验证失败", "B服安全验证失败320DPI" }) then
ttshitu_report()
ssleep(1.0)
back()
end
wait(function()
if not findAny({
"B服安全验证提交", "B服安全验证提交320DPI",
}) then
return true
end
ssleep(2)
back()
end, 5)
end
end
log(7)
end),
}
path.bilibili_login_change = update(path.bilibili_login, {
bilibili_oneclicklogin = false,
bilibili_username_inputbox = true,
bilibili_change2 = function()
if not wait(function()
findTap("bilibili_change2")
-- if appear({"bilibili_change", "bilibili_account_login"}, .5) then
if appear({ "bilibili_change", "bilibili_phone_inputbox" }, 1) then
return true
end
end, 5) then
-- B服卡登录
restartapp(appid)
end
end,
bilibili_change = function()
tap("bilibili_change")
-- appear("bilibili_account_login")
appear("bilibili_phone_inputbox")
end,
}, nil, true)
path.login = {
b服年度报告 = function()
tap("b服年度报告")
ssleep(0.5)
tap("b服年度报告关闭")
end,
同意协议 = function() return path.fallback.同意协议() end,
活动公告返回 = function() return path.fallback.活动公告返回() end,
阅读并同意 = function()
local p = findNode(point["阅读并同意"])
if p then
clickNodeFalse(p)
disappear("阅读并同意")
end
end,
同意并继续 = function()
local p = findNode(point["同意并继续"])
if p then
clickNodeFalse(p)
disappear("同意并继续")
end
end,
captcha = function() trySolveCapture() end,
ogame = true,
username_inputbox = disable_game_up_check_wrapper(function()
log(589, login_time_history)
-- 把输入法关了
wait(function()
if findOne("password_login") then path.login.password_login() end
if findOne("login") then return true end
tap("返回")
end, 2)
-- 存在两个输入框时,输入帐密
if findOne("username_inputbox") then
local input_box = findNodes(point["username_inputbox"])
if type(input_box) == 'table' and #input_box == 2 then
if not username or #username == 0 or not password or #password == 0 then
-- 单账号直接停,多账号跳过
stop("账号或密码为空", account_idx and 'next' or '')
end
wait(function() nodeLib.setText(input_box[1], username) end, 1)
wait(function() nodeLib.setText(input_box[2], password) end, 1)
-- 同意登录
local checkbox = findNodes(point["login_checkbox"])
if type(checkbox) == 'table' and checkbox[#checkbox].checked == false then
clickNodeFalse(checkbox[#checkbox])
end
end
end
login_error_times = (login_error_times or 0) + 1
if login_error_times > 2 then
stop("官服登录密码错误或设备数量超限",
account_idx and 'next' or '')
end
ssleep(.5) -- checkbox 需要延时
log(626, login_time_history)
if debug_mode then ssleep(1000) end
-- 开始唤醒时已经check了
-- check_login_frequency()
tap("login")
-- -- 多点一次登录
-- if not disappear("login") then
-- tap("login")
-- end
wait(function()
if findNode(point["防沉迷"]) then stop("防沉迷跳过", account_idx and 'next' or '') end
end, 2)
disappear("login")
appear({ "captcha", "B服安全验证", "B服安全验证320DPI" })
end),
login_switch = disable_game_up_check_wrapper(function()
check_login_frequency()
tap("login")
wait(function()
if findNode(point["防沉迷"]) then stop("防沉迷跳过", account_idx and 'next' or '') end
end, 2)
disappear("login")
appear({ "captcha", "B服安全验证", "B服安全验证320DPI" })
end),
password_login = function()
clickNodeFalse(findOne("password_login"))
disappear("password_login")
end,
B服安全验证320DPI = function()
return path.bilibili_login.B服安全验证()
end,
B服安全验证 = function() return path.bilibili_login.B服安全验证() end,
}
path.login_change = update(path.login, {
username_inputbox = true,
login_switch = function()
clickNodeFalse(findOne("login_switch"))
disappear("login_switch")
end,
}, nil, true)
path.fallback = {
同意协议 = function()
-- findTap({text = "下一步"})
-- ssleep(1)
local p = findOne("同意协议")
if p ~= nil then
local left, top = p.bounds.l, p.bounds.t
tap({ left - scale(10), top + scale(10) })
end
ssleep(1)
findTap({ text = "下一步" })
end,
未来序曲 = function()
-- "188|529|F3C4A2,1368|199|FF793F,1356|918|393939"
local w = scale(1370 - 1920 // 2) + screen.width // 2
for h = 199, 918, 50 do
h = scale(h - 1080 // 2) + screen.height // 2
tap({ w, h })
ssleep(.5)
end
tap("未来序曲领取")
tap("未来序曲领取2")
ssleep(1)
back()
if not appear("面板") then tap("开包skip") end
end,
产业合作洽谈会 = function()
ssleep(1)
wait(function() tap("产业合作洽谈会策略") end, 2)
wait(function()
tap('返回')
back()
if appear("面板", 1) then return true end
end, 5)
path.跳转('首页')
-- back()
-- disappear("产业合作洽谈会")
end,
月饼 = function()
wait(function() tap("月饼右") end, 2)
wait(function() tap("月饼确认") end, 2)
end,
-- 主题曲已开放 = function()
-- tap("主题曲已开放")
-- ssleep(1)
-- tap("主题曲已开放")
-- ssleep(1)
-- tap("主题曲已开放")
-- ssleep(1)
-- back()
-- end,
注册协议 = function()
tap("注册协议1")
ssleep(.5)
tap("注册协议2")
end,
可露希尔 = function()
for k, v in pairs(point.可露希尔右列表) do tap(v) end
for k, v in pairs(point.可露希尔左列表) do tap(v) end
tap("返回")
if appear("可露希尔", 5) then
ssleep(1)
return path.fallback.可露希尔()
end
end,
阿米娅 = function()
for k, v in pairs(point.阿米娅右列表) do tap(v) end
for k, v in pairs(point.阿米娅左列表) do tap(v) end
tap("返回")
if appear("阿米娅", 5) then
ssleep(1)
return path.fallback.阿米娅()
end
end,
阿米娅2 = function() return path.fallback.阿米娅() end,
覆巢之下主页 = function() tap("返回") end,
全权委托 = function()
wait(function()
tap("全权委托")
if not findOne("主页") then tap("开始行动蓝") end
ssleep(1)
if not findOne("全权委托") and findOne("代理指挥开") and
findOne("主页") then
return true
end
end, 30)
end,
开始行动活动 = function()
tap("返回")
appear("主页")
end,
线索传递界面 = function() tap("线索传递返回") end,
查看谢幕表 = function() tap("战略确认") end,
我知道了 = function() tap("我知道了") end,
剿灭提示 = function() tap("左上角返回") end,
获得物资 = function() tap("返回") end,
战略返回 = function()
tap("战略返回")
appear("常规行动", 2)
end,
断罪返回 = function()
tap("断罪返回")
disappear("断罪返回")
end,
-- 断罪 = function()
-- if appear("跳过剧情") then
-- tap("跳过剧情")
-- ssleep(1)
-- tap("跳过剧情确认")
-- end
-- end,
签到返回黄 = function() return path.fallback.签到返回() end,
回坑返回 = function() return path.fallback.签到返回() end,
签到返回 = function()
local x
local last_time_tap_return = time()
local start_time = time()
if not wait(function()
-- 曾出现 返回确认 误判为 活动公告返回
-- 返回确认3按back太快弹不出来
local timeout = min(2, (time() - start_time + 1000) / 1000 * 2 / 10)
log(237, timeout)
-- timeout = 0
x = appear({
"返回确认", "返回确认3", "主题曲已开放", "回归返回",
'start黄框', 'start黄框暗',
}, timeout)
-- disappear("开始行动", min(2, (time() - start_time) / 1000 * 2 / 2))
if x then return true end
back()
-- 每两秒按下返回,处理限时活动中领到干员/皮肤
if time() - last_time_tap_return > 5000 then
-- TODO:按返回在获得物资界面没用
tap("返回")
last_time_tap_return = time()
end
-- 干员/皮肤界面用返回键没用,这时按基建右上角
end, 30) then
auto_total_timeout_hook()
stop("返回键30秒超时", 'cur')
end
if x then return tap(path.fallback[x]) end
end,
回归返回 = function()
tap("回归返回")
ssleep(1)
return path.fallback.签到返回()
end,
活动公告返回 = function()
if not wait(function()
if disappear("活动公告返回", 1) then return true end
back()
end, 5) then
return restartapp(appid)
end
return path.fallback.签到返回()
end,
抽签返回 = function()
for u = scale(300), screen.width - scale(300), 200 do
tap({ u, screen.height // 2 })
end
tap("确定抽取")
return path.fallback.签到返回()
end,
活动签到返回 = function()
ssleep(0.5) -- 等待签到界面加载
for u = screen.width // 2 + scale(825 - 1920 // 2), screen.width // 2 +
scale(1730 - 1920 // 2), scale(100) do tap({ u, scale(500) }) end
for v = screen.height // 2 + scale(180 - 1080 // 2), screen.height // 2 +
scale(950 - 1080 // 2), scale(100) do tap({ screen.width // 2, v }) end
return path.fallback.签到返回()
end,
国庆签到返回 = function() return path.fallback.活动签到返回() end,
返回确认 = function()
log(191)
leaving_jump = false
if not wait(function()
if findOne("进驻总览") then zoom() end
if not findOne("返回确认") then return true end
-- 宽屏上有误判
if findOne("活动公告返回") then
path.fallback.活动公告返回()
return true
end
if stay_in_dorm_once then
back()
-- 必须等待
if disappear("返回确认", .5) and not appear("进驻总览", 1) then
-- 解决灯泡激活状态的死循环
tap("基建右上角")
end
else
tap("右确认")
end
end, 60) then
return restartapp(appid)
end
stay_in_dorm_once = false
if appear("进驻总览", 1) then leaving_jump = true end
end,
返回确认2 = "右确认",
返回确认3 = function()
wait(function()
if findAny({
"面板", "开始唤醒", "bilibili_framelayout_only",
"framelayout_only", "活动公告返回",
}) then
return true
end
tap("左取消")
end, 5)
end,
单选确认框 = "右确认",
剿灭说明 = function()
tap("基建右上角")
ssleep(1)
-- if not wait(function()
-- if findOne("主页") then return true end
-- tap("基建右上角")
-- end, 5) then stop(208) end
end,
行动结束 = function()
tap("行动结束")
-- if not wait(function()
-- if findOne("开始行动") and findOne("代理指挥开") then
-- return true
-- end
-- findTap("行动结束")
-- end, 10) then stop(217) end
end,
限时幸运签 = function()
tapAll(point.限时幸运签列表)
ssleep(.25)
tap("限时幸运签抽取")
disappear("限时幸运签", 10)
return path.fallback.签到返回()
end,
神州返回 = function()
wait(function()
tap("神州领取1")
ssleep(.2)
tap("神州领取2")
ssleep(.2)
end, 2)
wait(function()
tap("神州返回")
if appear("面板", 1) then return true end
end, 5)
end,
九色鹿签到返回 = function()
wait(function()
tap("九色鹿签到")
ssleep(.2)
end, 1)
wait(function()
tap("九色鹿签到返回")
ssleep(.2)
-- tap("开包skip")
if not appear("面板") then tap("开包skip") end
if appear("面板", 1) then
return true
else
tap("开包skip")
end
end, 5)
end,
战备支援签到返回 = function()
wait(function()
tap("战备支援签到")
ssleep(.2)
end, 1)
wait(function()
tap("战备支援签到返回")
ssleep(.2)
tap("开包skip")
if not appear("面板") then tap("开包skip") end
if appear("面板", 1) then return true end
end, 5)