-
Notifications
You must be signed in to change notification settings - Fork 3
/
齐格鲁德女帝鬼一奥伯龙@决战服2.6湖区-3面智能收尾(a5dc1153-c57c-4a0d-929f-eeeddd759791).mq
2429 lines (2385 loc) · 63.3 KB
/
齐格鲁德女帝鬼一奥伯龙@决战服2.6湖区-3面智能收尾(a5dc1153-c57c-4a0d-929f-eeeddd759791).mq
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
Dim EatApple= (Not ReadUIConfig("StartFromStage1")) And (ReadUIConfig("AppleType")<>0) // /*True///*/False//吃不吃果?
Dim OFF = 0 //关不关机
Dim AppleY=488, AppleNo=ReadUIConfig("AppleType")-CInt(ReadUIConfig("AppleType")>0) /*吃的苹果的Y坐标,苹果种类从上往下1-4*/
Dim SkillJudgePath="Attachment:cardok.png", xxx___=0, yyy___=0
/*用于判断是否可以继续操作的图,攻击/Attack上部蓝色*/
Dim paths
If ReadUIConfig("SupportType") = 2 Then // 奥伯龙
paths = Array("Attachment:obr1.png", "Attachment:obr2.png")//, "Attachment:caber2.png", "Attachment:caber3.png")//, "Attachment:waver.png", "Attachment:lord.png", "Attachment:lord2.png")
ElseIf ReadUIConfig("SupportType") = 1 // 活动C呆
paths = Array("Attachment:caber1p.png", "Attachment:caber2p.png", "Attachment:caber3p.png", "Attachment:caber4p.png")
ElseIf ReadUIConfig("SupportType") = 0 // 午茶C呆
paths = Array("Attachment:caber1.png", "Attachment:caber2.png", "Attachment:caber3.png", "Attachment:caber4.png")
End If
//找的助战需要何种从者/礼装
Dim SkillX=862/*技能x坐标*/, MasterSkillX=467/*御主技能X坐标*/, SingleSkillChooseX=657/*单体技能选择己方从者时的X坐标*/
Dim NPCardX=310, NormalCardX=845/*宝具卡普通卡的x坐标*/
Dim times=9, similarity=0.6//找助战时的下拉次数和相似度
Dim CardClassifyX = 500//用于判断卡色
Dim Y12 = 1540, Y23 = 1140, Y34 = 740, Y45 = 340//分割各普通卡的y坐标
Dim red=1, blue=2, green=3//卡色代号
Dim sup_id = 0
KeepScreen True //防止省电模式自动关屏
//Thread.Start(chkFGOrunning) //闪退对策
//出本时可能会点到菜单,先消一下
Dim QuestAP_X, QuestAP_Y, QuestType, QuestAP_Color = "0000E6" // for EndBattle
If ReadUIConfig("QuestType") = 0 Then // free21 324,663
QuestAP_X = 324
QuestAP_Y = 663
QuestType = "free21"
ElseIf ReadUIConfig("QuestType") = 1 Then // free22 320,678
QuestAP_X = 320
QuestAP_Y = 678
QuestType = "free22"
ElseIf ReadUIConfig("QuestType") = 2 Then // event40 390, 680
QuestAP_X = 390
QuestAP_Y = 680
QuestType = "event40"
ElseIf ReadUIConfig("QuestType") = 1 Then // 20AP yellow !!! TODO !!!
QuestAP_X = 0
QuestAP_Y = 0
QuestType = "20APyellow"
QuestAP_Color = "000000" //!!! TODO !!!
End If
//TracePrint QuestType, "EatApple =", EatApple, "AppleNo =", AppleNo, "Team =", ReadUIConfig("Team")+1
//TracePrint paths(0)
Dim loopTimes = CInt(ReadUIConfig("ExecTimes", 1))
For loopTimes
Rem LOOP_START
If ReadUIConfig("StartFromStage1") Then
Goto jj
End If
Delay 300
Tap 70,332
Delay 1700
Tap 302, 210 //进本
Delay 700
If FindPic(0, 0, 0, 0, "Attachment:UseItem.png", "000000", 0, 0.7, xx, yy) = 0 Then
If EatApple = True Then
Dim xx, yy
Delay 1100
Dim AppleX = GetEatAppleX(AppleNo)
Tap AppleX, AppleY //点苹果
Delay 3500 //留长一点,方便手动更改吃什么苹果
Tap 846,662 //确认吃苹果
Delay 1500
Else
EndScript
End If
End If
Delay 5000
If ReadUIConfig("SupportType") = 2 Then // 奥伯龙
Tap 195,968 // !!!点EX!!! ***************************************************
ElseIf ReadUIConfig("SupportType") = 1 // 活动C呆
Tap 189,1270
ElseIf ReadUIConfig("SupportType") = 0 // 午茶C呆
Tap 189,1270
End If
Delay 400
sup_id = ChkValidSupport(times, similarity) //找助战 切队伍
//TracePrint paths(sup_id)
ChangeTeam(ReadUIConfig("Team")+1)
TouchDown 1027,141, 1 //开始战斗
Delay 600
TouchUp 1
Delay 7000 //等待加载
Call Wait4OK()
Delay 500
Rem jj
Dim NPok = 0
Dim Svt = "Attachment:jkblue.png", Color=blue
//集中火力/克制相关
Dim Core = "Attachment:zhi.png"
Dim t = 1, t2=1, Phase2NPUsed = 0
// ************************** //
// **** MODIFY FROM HERE **** //
// ************************** //
Call TapSkill(2,0,0) // 齐格鲁德2 强化后
Call TapSkill(4,0,0) // 女帝1
Call TapSkill(7,0,0) // 鬼一1&2
Call TapSkill(8,1,2)
Do
If t = 4 Then
Call TapSkill(9,0,0) // 鬼一3
End If
Delay 100
Call ClickAttack()
Delay 150
Call RedCardsFirst()
Delay 7000
Call Wait4OK()
Delay 500
t = t+1
Loop Until isInStage2() = 1
If t = 4 Then
Call TapSkill(9,0,0) // 鬼一3
End If
If getHPpercent(1) < getHPpercent(2) Then
Call MasterSkill_OneUp(1,2) // 齐格鲁德回血
Else
Call MasterSkill_OneUp(2,2) // 女帝回血
End If
If t <= 5 Then
While t < 5
Delay 100
Call ClickAttack()
Delay 180
Tap 65, 1857 // 平砍左直到t==5
Delay 180
Call RedCardsFirst()
Delay 7000
Call Wait4OK()
Delay 500
t = t+1
Wend
// t=5
Call MasterSkill_ChangeServant(3,6) // 鬼一换奥伯龙
Call TapSkill(8,1,1) // 奥伯龙充齐格鲁德+出星
Call TapSkill(6,0,0) // 女帝3
Delay 100
Call ClickAttack()
Delay 180
Tap 65, 1857 // 平砍左
Delay 180
Call RedCardsFirst()
Delay 7000
Call Wait4OK()
Delay 500
t = t+1
// t=6
Call TapSkill(7,0,0) // 奥伯龙群充20
Call MasterSkill_AllATKUp(1) // 御主加攻
Call TapSkill(3,1,2) // 齐格鲁德3
Call TapSkill(4,0,0) // 女帝1
Delay 100
Call ClickAttack()
Delay 200
Call UseCards(7,1,2) //女帝宝具
Delay 7000
Call Wait4OK()
Delay 500
t = t+1
While isInStage2() = 1 // 没打死就继续平砍
Delay 100
Call ClickAttack()
Delay 180
Call RedCardsFirst()
Delay 7000
Call Wait4OK()
Delay 500
t = t+1
Wend
ElseIf t > 5 Then
Call TapSkill(8,1,2) // t6起 鬼一可再充20
Call MasterSkill_ChangeServant(3,6) // 鬼一换奥伯龙
Call TapSkill(8,1,1) // 奥伯龙2充齐格鲁德+出星
Call TapSkill(6,0,0) // 女帝3
Call MasterSkill_AllATKUp(1) // 御主加攻
Call TapSkill(3,1,2) // 齐格鲁德3
Call TapSkill(4,0,0) // 女帝1
Delay 100
Call ClickAttack()
Delay 200
Call UseCards(7,1,2) //女帝宝具
Delay 7000
Call Wait4OK()
Delay 500
t = t+1
Call TapSkill(7,0,0) // 奥伯龙1
While isInStage2() = 1 // 没打死就继续平砍
Delay 100
Call ClickAttack()
Delay 180
Call RedCardsFirst()
Delay 7000
Call Wait4OK()
Delay 500
t = t+1
Wend
End If
Call TapSkill(1,0,0)
Call TapSkill(2,0,0) // 齐格鲁德1&2
Call TapSkill(9,1,1) // 奥伯龙3
Delay 100
Call ClickAttack()
Delay 200
Call RedFirst_NP(6,1)
Delay 25000
While True
Tap 176, 176
Delay 200
If FindPic(0,0,0,0, "Attachment:Next.png", "000000", 0, 0.73, xxx___, yyy___) = 0 // Next
Exit While
ElseIf FindPic(787, 111, 852, 323, SkillJudgePath, "000000", 3, 0.7, xxx___, yyy___) = 0 // Attack
Call Wait4OK()
Delay 500
Call ClickAttack()
Delay 300
Call RedCardsFirst()
Delay 8000
End If
Wend
// ************************** //
// **** MODIFY ENDS HERE **** //
// ************************** //
Call EndBattle() // if NOT EatApple, Script ends here.
If ReadUIConfig("StartFromStage1") Then
EndScript
End If
If ReadUIConfig("infLoop") Then
Goto LOOP_START
End If
Next
/* Wise End for the last Stage
While True
Tap 176, 176
Delay 200
If FindPic(0,0,0,0, "Attachment:Next.png", "000000", 0, 0.73, xxx___, yyy___) = 0 // Next
Exit While
ElseIf FindPic(787, 111, 852, 323, SkillJudgePath, "000000", 3, 0.7, xxx___, yyy___) = 0 // Attack
Call Wait4OK()
Delay 500
Call ClickAttack()
Delay 300
Call RedCardsFirst()
Delay 8000
End If
Wend
*/
Function FocusOn(TargetPlace, forced)
/* 集中火力平A 若有Core的多张卡 则去打大怪,否则打其他小怪 */
//这里是狂黑贞+齐格刷炉心
//Dim Core = "Attachment:JAB.png"
Delay 200 //等星星分配完
Dim cards = Array(0, 0, 0, 0, 0)
Dim svts = Array(0, 0, 0, 0, 0)
Dim use = Array(0, 0, 0)
Dim i=0, redSum=0, blueSum=0, greenSum=0
Dim CoreCardColor = Array(0,0,0,0,0)
//各卡是黑贞的什么卡,0代表非黑贞
Dim CoreRed=0, CoreBlue=0, CoreGreen=0
//输出手三色卡的各自数量
KeepCapture
cards(0) = IdentifyCardColor(1920, Y12)
cards(1) = IdentifyCardColor(Y12, Y23)
cards(2) = IdentifyCardColor(Y23, Y34)
cards(3) = IdentifyCardColor(Y34, Y45)
cards(4) = IdentifyCardColor(Y45, 0)
svts(0) = IdentifyCardServant(Core, 1920, Y12)
svts(1) = IdentifyCardServant(Core, Y12, Y23)
svts(2) = IdentifyCardServant(Core, Y23, Y34)
svts(3) = IdentifyCardServant(Core, Y34, Y45)
svts(4) = IdentifyCardServant(Core, Y45, 0)
/*可以在这里往svt加输出副手的有关信息*/
ReleaseCapture
//计算各色卡数量和黑贞各色卡情况
For i = 0 To 4
If (cards(i) = red) Then
redSum = redSum+1
ElseIf (cards(i) = blue) Then
blueSum = blueSum+1
ElseIf (cards(i) = green) Then
greenSum = greenSum+1
End If
If svts(i) = 1 Then
CoreCardColor(i) = cards(i)
If (cards(i) = red) Then
CoreRed = CoreRed+1
ElseIf (cards(i) = blue) Then
CoreBlue = CoreBlue+1
ElseIf (cards(i) = green) Then
CoreGreen = CoreGreen+1
End If
End If
Next
TracePrint CoreCardColor(0), CoreCardColor(1), CoreCardColor(2), CoreCardColor(3), CoreCardColor(4)
//大怪位置左到右1 2 3,决定了在不打大怪的时候选什么位置的小怪,优先中间,没有就选最左
//1 65,1857 || 2 65,1481 || 3 73,1131
If CoreRed + CoreBlue + CoreGreen < 2 And forced = 0 Then
Delay 100
If TargetPlace = 1 Then
Tap 73, 1131
Delay 100
Tap 65,1481
ElseIf TargetPlace = 2 Then
Tap 73, 1131
Delay 100
Tap 65,1857
Else
Tap 65, 1857
Delay 100
Tap 65,1481
End If
TracePrint "Small"
Else
Delay 100
If TargetPlace = 1 Then
Tap 65,1857
ElseIf TargetPlace = 2 Then
Tap 65,1481
Else
Tap 73,1131
End If
TracePrint "Big"
End If
Delay 153
Dim capacity = 0, FillCounter = 0
//3张卡 BBB > BAB > BQB > BAA > BQA > BQQ > AAA > QQQ
If CoreRed >= 3 Then
For i = 0 To 4
If (CoreCardColor(i) = red) Then
use(capacity) = i+1
capacity = capacity + 1
If capacity = 3 Then
Exit For
End If
End If
Next
ElseIf (CoreRed = 2 And CoreBlue >= 1) Then
//BAB
For i = 0 To 4
If (CoreCardColor(i) = red) Then
If (use(0) = 0) Then
FillCounter = FillCounter + 1
use(0) = i+1
Else
FillCounter = FillCounter + 1
use(2) = i+1
End If
ElseIf (CoreCardColor(i) = blue) Then
FillCounter = FillCounter + 1
use(1) = i+1
End If
If FillCounter = 3 Then
Exit For
End If
Next
ElseIf (CoreRed = 2 And CoreGreen >= 1) Then
//BQB
For i = 0 To 4
If (CoreCardColor(i) = red) Then
If (use(0) = 0) Then
FillCounter = FillCounter + 1
use(0) = i+1
Else
FillCounter = FillCounter + 1
use(2) = i+1
End If
ElseIf (CoreCardColor(i) = green) Then
FillCounter = FillCounter + 1
use(1) = i+1
End If
If FillCounter = 3 Then
Exit For
End If
Next
ElseIf (CoreRed = 1 And CoreBlue >= 2) Then
//BAA
For i = 0 To 4
If (CoreCardColor(i) = red) Then
FillCounter = FillCounter + 1
use(0) = i+1
ElseIf (CoreCardColor(i) = blue) Then
FillCounter = FillCounter + 1
If (use(1) = 0) Then
use(1) = i+1
Else
use(2) = i+1
End If
End If
If FillCounter = 3 Then
Exit For
End If
Next
ElseIf (CoreRed = 1 And CoreBlue = 1 And CoreGreen=1) Then
//BQA
For i = 0 To 4
If (CoreCardColor(i) = red) Then
FillCounter = FillCounter + 1
use(0) = i+1
ElseIf (CoreCardColor(i) = green) Then
FillCounter = FillCounter + 1
use(1) = i+1
ElseIf (CoreCardColor(i) = blue) Then
FillCounter = FillCounter + 1
use(2) = i+1
End If
If FillCounter = 3 Then
Exit For
End If
Next
ElseIf (CoreRed = 1 And CoreGreen >= 2) Then
//BQQ
For i = 0 To 4
If (CoreCardColor(i) = red) Then
FillCounter = FillCounter + 1
use(0) = i+1
ElseIf (CoreCardColor(i) = green) Then
FillCounter = FillCounter + 1
If (use(1) = 0) Then
use(1) = i+1
Else
use(2) = i+1
End If
End If
If FillCounter = 3 Then
Exit For
End If
Next
ElseIf (CoreBlue >= 3) Then
//AAA
For i = 0 To 4
If (CoreCardColor(i) = blue) Then
use(capacity) = i+1
capacity = capacity + 1
If capacity = 3 Then
Exit For
End If
End If
Next
ElseIf (CoreGreen >= 3) Then
//QQQ
For i = 0 To 4
If (CoreCardColor(i) = green) Then
use(capacity) = i+1
capacity = capacity + 1
If capacity = 3 Then
Exit For
End If
End If
Next
End If
If (use(0) <> 0 And use(1) <> 0 And use(2) <> 0) Then
TracePrint use(0), use(1), use(2)
Call UseCards(use(0), use(1), use(2))
Exit Function
End If
//黑贞卡数量不满足以上组合的情况 BB/BA/BQ/AQ/B/A/Q
capacity = 0
FillCounter = 0
If (CoreRed = 2) Then
//BXB
For i = 0 To 4
If (CoreCardColor(i) = red) Then
If (use(0) = 0) Then
use(0) = i + 1
Else
use(2) = i + 1
End If
End If
Next
//找别的卡
For i = 0 To 4
If (use(0) <> i+1 And use(2) <> i+1) Then
If (cards(i) = green) Then
use(1) = i + 1
ElseIf (cards(i) = blue And cards(use(1)-1)<>red) Then
use(1) = i + 1
ElseIf (cards(i) = red) Then
use(1) = i + 1
End If
End If
Next
ElseIf (CoreRed = 1 And CoreBlue = 1) Then
If redSum = CoreRed Then
//BXA
For i = 0 To 4
If (CoreCardColor(i) = red) Then
use(0) = i + 1
ElseIf (CoreCardColor(i) = blue) Then
use(2) = i + 1
End If
Next
//找别的卡
For i = 0 To 4
If (use(0) <> i+1 And use(2) <> i+1) Then
If (cards(i) = green) Then
use(1) = i + 1
ElseIf (cards(i) = blue And cards(use(1)-1)<>red) Then
use(1) = i + 1
ElseIf (cards(i) = red) Then
use(1) = i + 1
End If
End If
Next
Else
//XAB, X=red
For i = 0 To 4
If (CoreCardColor(i) = red) Then
use(2) = i + 1
ElseIf (CoreCardColor(i) = blue) Then
use(1) = i + 1
End If
Next
//找别的卡
For i = 0 To 4
If (use(1) <> i+1 And use(2) <> i+1) Then
If (cards(i) = red) Then
use(0) = i + 1
End If
End If
Next
End If
ElseIf (CoreRed = 1 And CoreGreen = 1) Then
If redSum = CoreRed Then
//BXQ
For i = 0 To 4
If (CoreCardColor(i) = red) Then
use(0) = i + 1
ElseIf (CoreCardColor(i) = green) Then
use(2) = i + 1
End If
Next
//找别的卡
For i = 0 To 4
If (use(0) <> i+1 And use(2) <> i+1) Then
If (cards(i) = green) Then
use(1) = i + 1
ElseIf (cards(i) = blue And cards(use(1)-1)<>red) Then
use(1) = i + 1
ElseIf (cards(i) = red) Then
use(1) = i + 1
End If
End If
Next
Else
//XQB, X=red
For i = 0 To 4
If (CoreCardColor(i) = red) Then
use(2) = i + 1
ElseIf (CoreCardColor(i) = green) Then
use(1) = i + 1
End If
Next
//找别的卡
For i = 0 To 4
If (use(1) <> i+1 And use(2) <> i+1) Then
If (cards(i) = red) Then
use(0) = i + 1
End If
End If
Next
End If
ElseIf (CoreBlue = 1 And CoreGreen = 1) Then
//XQA
For i = 0 To 4
If (CoreCardColor(i) = green) Then
use(1) = i + 1
ElseIf (CoreCardColor(i) = blue) Then
use(2) = i + 1
End If
Next
//找别的卡
For i = 0 To 4
If (use(1) <> i+1 And use(2) <> i+1) Then
If (cards(i) = green And use(0)=0) Then
use(0) = i + 1
ElseIf (cards(i) = blue And cards(use(0)-1)<>red) Then
use(0) = i + 1
ElseIf (cards(i) = red) Then
use(0) = i + 1
End If
End If
Next
ElseIf CoreRed = 1 Or CoreBlue = 1 Or CoreGreen = 1 Then
If CoreRed = redSum And CoreRed = 1 Then
For i = 0 To 4
If (svts(i) = 1) Then
use(0) = i + 1
Exit For
End If
Next
//找别的卡 填充第三张卡
For i = 0 To 4
If (use(0) <> i+1) Then
If (cards(i) = green And use(2)=0) Then
use(2) = i + 1
ElseIf (cards(i) = blue And cards(use(2)-1)<>red) Then
use(2) = i + 1
ElseIf (cards(i) = red) Then
use(2) = i + 1
End If
End If
Next
//找别的卡 填充第二张卡
For i = 0 To 4
If (use(2) <> i+1 And use(0) <> i+1 ) Then
If (cards(i) = green And use(1)=0) Then
use(1) = i + 1
ElseIf (cards(i) = blue And cards(use(1)-1)<>red) Then
use(1) = i + 1
ElseIf (cards(i) = red) Then
use(1) = i + 1
End If
End If
Next
Else
For i = 0 To 4
If (svts(i) = 1) Then
use(2) = i + 1
Exit For
End If
Next
//找别的卡 填充第一张卡
For i = 0 To 4
If (use(2) <> i+1) Then
If (cards(i) = green And use(0)=0) Then
use(0) = i + 1
ElseIf (cards(i) = blue And cards(use(0)-1)<>red) Then
use(0) = i + 1
ElseIf (cards(i) = red) Then
use(0) = i + 1
End If
End If
Next
//找别的卡 填充第二张卡
For i = 0 To 4
If (use(2) <> i+1 And use(0) <> i+1 ) Then
If (cards(i) = green And use(1)=0) Then
use(1) = i + 1
ElseIf (cards(i) = blue And cards(use(1)-1)<>red) Then
use(1) = i + 1
ElseIf (cards(i) = red) Then
use(1) = i + 1
End If
End If
Next
End If
Else
//剩下的情况用RedFirst
Call RedCardsFirst()
Exit Function
End If
TracePrint use(0), use(1), use(2)
Call UseCards(use(0), use(1), use(2))
End Function
Function Advantage(TargetPlace)
/* 克制集中火力平A 若有克制的多张卡 则去打大怪,否则打其他小怪 */
//Dim Core = "Attachment:JAB.png"
Dim adv = "Attachment:zhi.png"
Delay 200 //等星星分配完
Dim cards = Array(0, 0, 0, 0, 0)
Dim svts = Array(0, 0, 0, 0, 0)
Dim use = Array(0, 0, 0)
Dim i=0, redSum=0, blueSum=0, greenSum=0
Dim CoreCardColor = Array(0,0,0,0,0)
//各卡是克制的什么卡,0代表非克制
Dim CoreRed=0, CoreBlue=0, CoreGreen=0
//先点大怪 看有多少克制的
Delay 100
If TargetPlace = 1 Then
Tap 65,1857
ElseIf TargetPlace = 2 Then
Tap 65,1481
Else
Tap 73,1131
End If
//克制的三色卡的各自数量
Delay 200
//Tap 5,5 // 现在点已经选中的会弹出buff框框 用这个消除
Delay 100
KeepCapture
cards(0) = IdentifyCardColor(1920, Y12)
cards(1) = IdentifyCardColor(Y12, Y23)
cards(2) = IdentifyCardColor(Y23, Y34)
cards(3) = IdentifyCardColor(Y34, Y45)
cards(4) = IdentifyCardColor(Y45, 0)
svts(0) = IdentifyCardServant(adv, 1920, Y12)
svts(1) = IdentifyCardServant(adv, Y12, Y23)
svts(2) = IdentifyCardServant(adv, Y23, Y34)
svts(3) = IdentifyCardServant(adv, Y34, Y45)
svts(4) = IdentifyCardServant(adv, Y45, 0)
ReleaseCapture
//计算各色卡数量和克制各色卡情况
For i = 0 To 4
If (cards(i) = red) Then
redSum = redSum+1
ElseIf (cards(i) = blue) Then
blueSum = blueSum+1
ElseIf (cards(i) = green) Then
greenSum = greenSum+1
End If
If svts(i) = 1 Then
CoreCardColor(i) = cards(i)
If (cards(i) = red) Then
CoreRed = CoreRed+1
ElseIf (cards(i) = blue) Then
CoreBlue = CoreBlue+1
ElseIf (cards(i) = green) Then
CoreGreen = CoreGreen+1
End If
End If
Next
TracePrint CoreCardColor(0), CoreCardColor(1), CoreCardColor(2), CoreCardColor(3), CoreCardColor(4)
//大怪位置左到右1 2 3,决定了在不打大怪的时候选什么位置的小怪,优先中间,没有就选最左
//1 65,1857 || 2 65,1481 || 3 73,1131
If CoreRed+CoreBlue+CoreGreen<2
Delay 100
If TargetPlace = 1 Then
Tap 73, 1131
Delay 100
Tap 65,1481
ElseIf TargetPlace = 2 Then
Tap 73, 1131
Delay 100
Tap 65,1857
Else
Tap 65, 1857
Delay 100
Tap 65,1481
End If
TracePrint "Small"
Delay 105
//不适合打大怪 点完小怪以后重新识别
i = 0
redSum = 0
blueSum = 0
greenSum=0
CoreCardColor = Array(0,0,0,0,0)
//各卡是克制的什么卡,0代表非克制
CoreRed = 0
CoreBlue=0
CoreGreen=0
KeepCapture
svts(0) = IdentifyCardServant(adv, 1920, Y12)
svts(1) = IdentifyCardServant(adv, Y12, Y23)
svts(2) = IdentifyCardServant(adv, Y23, Y34)
svts(3) = IdentifyCardServant(adv, Y34, Y45)
svts(4) = IdentifyCardServant(adv, Y45, 0)
ReleaseCapture
//计算各色卡数量和克制各色卡情况
For i = 0 To 4
If (cards(i) = red) Then
redSum = redSum+1
ElseIf (cards(i) = blue) Then
blueSum = blueSum+1
ElseIf (cards(i) = green) Then
greenSum = greenSum+1
End If
If svts(i) = 1 Then
CoreCardColor(i) = cards(i)
If (cards(i) = red) Then
CoreRed = CoreRed+1
ElseIf (cards(i) = blue) Then
CoreBlue = CoreBlue+1
ElseIf (cards(i) = green) Then
CoreGreen = CoreGreen+1
End If
End If
Next
TracePrint CoreCardColor(0), CoreCardColor(1), CoreCardColor(2), CoreCardColor(3), CoreCardColor(4)
Else
Delay 100
If TargetPlace = 1 Then
Tap 65,1857
ElseIf TargetPlace = 2 Then
Tap 65,1481
Else
Tap 73,1131
End If
TracePrint "Big"
End If
Delay 153
TracePrint "B=",redSum,"A=",blueSum,"Q=",greenSum
Dim capacity = 0, FillCounter = 0
//3张卡 BBB > BAB > BQB > BAA > BQA > BQQ > AAA > QQQ
If CoreRed >= 3 Then
For i = 0 To 4
If (CoreCardColor(i) = red) Then
use(capacity) = i+1
capacity = capacity + 1
If capacity = 3 Then
Exit For
End If
End If
Next
ElseIf (CoreRed = 2 And CoreBlue >= 1) Then
//BAB
For i = 0 To 4
If (CoreCardColor(i) = red) Then
If (use(0) = 0) Then
FillCounter = FillCounter + 1
use(0) = i+1
Else
FillCounter = FillCounter + 1
use(2) = i+1
End If
ElseIf (CoreCardColor(i) = blue) Then
FillCounter = FillCounter + 1
use(1) = i+1
End If
If FillCounter = 3 Then
Exit For
End If
Next
ElseIf (CoreRed = 2 And CoreGreen >= 1) Then
//BQB
For i = 0 To 4
If (CoreCardColor(i) = red) Then
If (use(0) = 0) Then
FillCounter = FillCounter + 1
use(0) = i+1
Else
FillCounter = FillCounter + 1
use(2) = i+1
End If
ElseIf (CoreCardColor(i) = green) Then
FillCounter = FillCounter + 1
use(1) = i+1
End If
If FillCounter = 3 Then
Exit For
End If
Next
ElseIf (CoreRed = 1 And CoreBlue >= 2) Then
//BAA
For i = 0 To 4
If (CoreCardColor(i) = red) Then
FillCounter = FillCounter + 1
use(0) = i+1
ElseIf (CoreCardColor(i) = blue) Then
FillCounter = FillCounter + 1
If (use(1) = 0) Then
use(1) = i+1
Else
use(2) = i+1
End If
End If
If FillCounter = 3 Then
Exit For
End If
Next
ElseIf (CoreRed = 1 And CoreBlue = 1 And CoreGreen=1) Then
//BQA
For i = 0 To 4
If (CoreCardColor(i) = red) Then
FillCounter = FillCounter + 1
use(0) = i+1
ElseIf (CoreCardColor(i) = green) Then
FillCounter = FillCounter + 1
use(1) = i+1
ElseIf (CoreCardColor(i) = blue) Then
FillCounter = FillCounter + 1
use(2) = i+1
End If
If FillCounter = 3 Then
Exit For
End If
Next
ElseIf (CoreRed = 1 And CoreGreen >= 2) Then
//BQQ
For i = 0 To 4
If (CoreCardColor(i) = red) Then
FillCounter = FillCounter + 1
use(0) = i+1
ElseIf (CoreCardColor(i) = green) Then
FillCounter = FillCounter + 1
If (use(1) = 0) Then
use(1) = i+1
Else
use(2) = i+1
End If
End If
If FillCounter = 3 Then
Exit For
End If
Next
ElseIf (CoreBlue >= 3) Then
//AAA
For i = 0 To 4
If (CoreCardColor(i) = blue) Then
use(capacity) = i+1
capacity = capacity + 1
If capacity = 3 Then
Exit For
End If
End If
Next
ElseIf (CoreGreen >= 3) Then
//QQQ
For i = 0 To 4
If (CoreCardColor(i) = green) Then
use(capacity) = i+1
capacity = capacity + 1
If capacity = 3 Then
Exit For
End If
End If
Next
End If
If (use(0) <> 0 And use(1) <> 0 And use(2) <> 0) Then
TracePrint use(0), use(1), use(2)
Call UseCards(use(0), use(1), use(2))
Exit Function
End If
//不满足以上组合的情况 BB/BA/BQ/AQ/B/A/Q
capacity = 0
FillCounter = 0
If (CoreRed = 2) Then
//BXB
For i = 0 To 4
If (CoreCardColor(i) = red) Then
If (use(0) = 0) Then
use(0) = i + 1
Else
use(2) = i + 1
End If
End If
Next
//找别的卡
For i = 0 To 4
//TracePrint i
If (use(0) <> i + 1 And use(2) <> i + 1) Then
//TracePrint cards(use(1)-1),"=",red," ",cards(i),"=",blue
If (cards(i) = green) Then
use(1) = i + 1
ElseIf (cards(i) = blue And cards(use(1)-1) <> red) Then
use(1) = i + 1
ElseIf (cards(i) = red) Then
use(1) = i + 1
End If
End If
Next
ElseIf (CoreRed = 1 And CoreBlue = 1) Then
If redSum = CoreRed Then
//BXA
For i = 0 To 4
If (CoreCardColor(i) = red) Then
use(0) = i + 1
ElseIf (CoreCardColor(i) = blue) Then
use(2) = i + 1
End If
Next
//找别的卡
For i = 0 To 4
If (use(0) <> i+1 And use(2) <> i+1) Then
If (cards(i) = green) Then
use(1) = i + 1
ElseIf (cards(i) = blue And cards(use(1)-1)<>red) Then
use(1) = i + 1
ElseIf (cards(i) = red) Then
use(1) = i + 1
End If
End If
Next
Else
//XAB, X=red
For i = 0 To 4
If (CoreCardColor(i) = red) Then
use(2) = i + 1
ElseIf (CoreCardColor(i) = blue) Then
use(1) = i + 1
End If
Next
//找别的卡
For i = 0 To 4
If (use(1) <> i+1 And use(2) <> i+1) Then
If (cards(i) = red) Then
use(0) = i + 1
End If
End If
Next
End If
ElseIf (CoreRed = 1 And CoreGreen = 1) Then
If redSum = CoreRed Then
//BXQ
For i = 0 To 4
If (CoreCardColor(i) = red) Then
use(0) = i + 1
ElseIf (CoreCardColor(i) = green) Then