-
Notifications
You must be signed in to change notification settings - Fork 2
/
DoroHelper.ahk
4035 lines (3399 loc) · 112 KB
/
DoroHelper.ahk
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
#Requires AutoHotkey >=v2.0
#Include %A_ScriptDir%\lib\github.ahk
CoordMode "Pixel", "Client"
CoordMode "Mouse", "Client"
;操作间隔(单位:毫秒)
sleepTime := 1500
scrRatio := 1.0
;consts
stdScreenW := 3840
stdScreenH := 2160
waitTolerance := 50
colorTolerance := 15
currentVersion := "v0.1.17.3"
usr := "kyokakawaii"
repo := "DoroHelper"
;utilities
IsSimilarColor(targetColor, color)
{
tr := Format("{:d}", "0x" . substr(targetColor, 3, 2))
tg := Format("{:d}", "0x" . substr(targetColor, 5, 2))
tb := Format("{:d}", "0x" . substr(targetColor, 7, 2))
pr := Format("{:d}", "0x" . substr(color, 3, 2))
pg := Format("{:d}", "0x" . substr(color, 5, 2))
pb := Format("{:d}", "0x" . substr(color, 7, 2))
;MsgBox tr tg tb pr pg pb
distance := sqrt((tr - pr) ** 2 + (tg - pg) ** 2 + (tb - pb) ** 2)
if (distance < colorTolerance)
return true
return false
}
ClickOnCheckForUpdate(*)
{
latestObj := Github.latest(usr, repo)
if currentVersion != latestObj.version
{
userResponse := MsgBox(
"DoroHelper存在更新版本:`n"
"`nVersion: " latestObj.version
"`nNotes:`n"
. latestObj.change_notes
"`n`n是否下载?",, '36')
if (userResponse = "Yes") {
try {
Github.Download(latestObj.downloadURLs[1], A_ScriptDir "\DoroDownload")
}
catch as err {
MsgBox "下载失败,请检查网络。"
}
else {
FileMove "DoroDownload.exe", "DoroHelper-" latestObj.version ".exe"
MsgBox "已下载至当前目录。"
ExitApp
}
}
}
else {
MsgBox "当前Doro已是最新版本。"
}
}
CheckForUpdate()
{
latestObj := Github.latest(usr, repo)
if currentVersion != latestObj.version
{
userResponse := MsgBox(
"DoroHelper存在更新版本:`n"
"`nVersion: " latestObj.version
"`nNotes:`n"
. latestObj.change_notes
"`n`n是否下载?",, '36')
if (userResponse = "Yes") {
try {
Github.Download(latestObj.downloadURLs[1], A_ScriptDir "\DoroDownload")
}
catch as err {
MsgBox "下载失败,请检查网络。"
}
else {
FileMove "DoroDownload.exe", "DoroHelper-" latestObj.version ".exe"
MsgBox "已下载至当前目录。"
ExitApp
}
}
}
}
;functions
UserClick(sX, sY, k)
{
uX := Round(sX * k)
uY := Round(sY * k)
Send "{Click " uX " " uY "}"
}
UserCheckColor(sX, sY, sC, k)
{
loop sX.Length {
uX := Round(sX[A_Index] * k)
uY := Round(sY[A_Index] * k)
uC := PixelGetColor(uX, uY)
if (!IsSimilarColor(uC, sC[A_Index]))
return 0
}
return 1
}
isAutoOff(sX, sY, k)
{
uX := Round(sX * k)
uY := Round(sY * k)
uC := PixelGetColor(uX, uY)
r := Format("{:d}", "0x" . substr(uC, 3, 2))
g := Format("{:d}", "0x" . substr(uC, 5, 2))
b := Format("{:d}", "0x" . substr(uC, 7, 2))
if Abs(r - g) < 10 && Abs(r - b) < 10 && Abs(g - b) < 10
return true
return false
}
autoBurstOn := false
autoAimOn := false
CheckAutoBattle()
{
global autoBurstOn
global autoAimOn
if !autoAimOn && UserCheckColor([216], [160], ["0xFFFFFF"], scrRatio) {
if isAutoOff(60, 57, scrRatio) {
UserClick(60, 71, scrRatio)
Sleep sleepTime
}
autoAimOn := true
}
if !autoBurstOn && UserCheckColor([216], [160], ["0xFFFFFF"], scrRatio) {
if isAutoOff(202, 66, scrRatio) {
Send "{Tab}"
Sleep sleepTime
}
autoBurstOn := true
}
}
Login()
{
stdTargetX := 333
stdTargetY := 2041
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [64]
stdCkptY := [470]
desiredColor := ["0xFAA72C"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
if UserCheckColor([1973, 1969], [1368, 1432], ["0x00ADFB", "0x00ADFB"], scrRatio) {
UserClick(2127, 1400, scrRatio)
Sleep sleepTime
}
if UserCheckColor([1965, 1871], [1321, 1317], ["0x00A0EB", "0xF7F7F7"], scrRatio) {
UserClick(2191, 1350, scrRatio)
Sleep sleepTime
}
if UserCheckColor([1720, 2111], [1539, 1598], ["0x00AEFF", "0x00AEFF"], scrRatio) {
UserClick(1905, 1568, scrRatio)
Sleep sleepTime
}
if A_Index > waitTolerance * 50 {
MsgBox "登录失败!"
ExitApp
}
}
}
BackToHall()
{
stdTargetX := 333
stdTargetY := 2041
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [64]
stdCkptY := [470]
desiredColor := ["0xFAA72C"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
if A_Index > waitTolerance {
MsgBox "退回大厅失败!"
ExitApp
}
}
}
;=============================================================
;1: 防御前哨基地奖励
OutpostDefence()
{
Start:
stdTargetX := 1092
stdTargetY := 1795
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
;standard checkpoint
stdCkptX := [1500, 1847]
stdCkptY := [1816, 1858]
desiredColor := ["0xF8FCFD", "0xF7FCFD"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
if A_Index > waitTolerance {
MsgBox "进入防御前哨失败!"
ExitApp
}
if A_Index > 10 {
BackToHall()
goto Start
}
}
;一举歼灭
stdTargetX := 1686
stdTargetY := 1846
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [1500, 1847]
stdCkptY := [1816, 1858]
desiredColor := ["0xF8FCFD", "0xF7FCFD"]
while UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
if A_Index > waitTolerance {
MsgBox "进入一举歼灭失败!"
ExitApp
}
if A_Index > 10 {
BackToHall()
goto Start
}
}
;如有免费次数则扫荡,否则跳过
stdCkptX := [1933]
stdCkptY := [1648]
desiredColor := ["0xE9ECF0"]
if !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
stdTargetX := 2093
stdTargetY := 1651
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
;UserClick(stdTargetX, stdTargetY, scrRatio)
;Sleep sleepTime
stdCkptX := [1933]
stdCkptY := [1648]
desiredColor := ["0x11ADF5"]
while UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
if UserCheckColor([2088], [1327], ["0x00A0EB"], scrRatio) {
UserClick(2202, 1342, scrRatio)
}
if A_Index > 10 {
BackToHall()
goto Start
}
}
;如果升级,把框点掉
stdCkptX := [2356]
stdCkptY := [1870]
desiredColor := ["0x0EAFF4"]
stdTargetX := 2156
stdTargetY := 1846
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
if UserCheckColor([2088], [1327], ["0x00A0EB"], scrRatio) {
UserClick(2202, 1342, scrRatio)
}
if A_Index > 10 {
BackToHall()
goto Start
}
}
}
else {
stdCkptX := [2356]
stdCkptY := [1870]
desiredColor := ["0x0EAFF4"]
stdTargetX := 2156
stdTargetY := 1846
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
if UserCheckColor([2088], [1327], ["0x00A0EB"], scrRatio) {
UserClick(2202, 1342, scrRatio)
}
if A_Index > 10 {
BackToHall()
goto Start
}
}
}
;获得奖励
stdTargetX := 2156
stdTargetY := 1846
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
;UserClick(stdTargetX, stdTargetY, scrRatio)
;Sleep sleepTime // 2
;多点一下,以防升级
;UserClick(stdTargetX, stdTargetY, scrRatio)
;Sleep sleepTime // 2
stdCkptX := [64]
stdCkptY := [470]
desiredColor := ["0xFAA72C"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
if UserCheckColor([2088], [1327], ["0x00A0EB"], scrRatio) {
UserClick(2202, 1342, scrRatio)
}
if A_Index > waitTolerance {
MsgBox "前哨基地防御异常!"
ExitApp
}
if A_Index > 10 {
BackToHall()
goto Start
}
}
}
;=============================================================
;2: 付费商店每日每周免费钻
CashShop()
{
;进入商店
stdTargetX := 1163
stdTargetY := 1354
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [158, 199]
stdCkptY := [525, 439]
desiredColor := ["0x0DC2F4", "0x3B3E41"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
if UserCheckColor([2047], [1677], ["0x00A0EB"], scrRatio) or UserCheckColor([2047], [1677], ["0x9A9B9A"], scrRatio) {
UserClick(1789, 1387, scrRatio)
Sleep sleepTime
UserClick(1789, 1387, scrRatio)
Sleep sleepTime
UserClick(2144, 1656, scrRatio)
Sleep sleepTime
while UserCheckColor([2047], [1677], ["0x00A0EB"], scrRatio) {
UserClick(2144, 1656, scrRatio)
Sleep sleepTime
}
break
}
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
if UserCheckColor([2088], [1327], ["0x00A0EB"], scrRatio) {
UserClick(2202, 1342, scrRatio)
}
if A_Index > waitTolerance {
MsgBox "进入付费商店失败!"
ExitApp
}
}
Sleep sleepTime
if UserCheckColor([2047], [1677], ["0x00A0EB"], scrRatio) or UserCheckColor([2047], [1677], ["0x9A9B9A"], scrRatio) {
UserClick(1789, 1387, scrRatio)
Sleep sleepTime
UserClick(1789, 1387, scrRatio)
Sleep sleepTime
UserClick(2144, 1656, scrRatio)
Sleep sleepTime
while UserCheckColor([2047], [1677], ["0x00A0EB"], scrRatio) {
UserClick(2144, 1656, scrRatio)
Sleep sleepTime
}
}
delta := false
stdCkptX := [52]
stdCkptY := [464]
desiredColor := ["0xF7FCFD"]
if UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio)
delta := true
stdTargetX := 256
if delta
stdTargetX := 432
stdTargetY := 486
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [194]
if delta
stdCkptX := [373]
stdCkptY := [436]
desiredColor := ["0x0FC7F5"]
if delta
desiredColor := ["0x0BC7F4"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "进入礼包页面失败!"
ExitApp
}
}
stdCkptX := [514]
stdCkptY := [1018]
desiredColor := ["0xF2F8FC"]
if UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
stdTargetX := stdTargetX - 172
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
}
del := 336
stdCkptX := [1311]
stdCkptY := [612]
desiredColor := ["0xA0A0AC"]
if UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio)
del := 0
;每日
stdTargetX := 545 - del
stdTargetY := 610
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [431 - del]
stdCkptY := [594]
desiredColor := ["0x0EC7F5"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "进入每日礼包页面失败!"
ExitApp
}
}
stdTargetX := 212
stdTargetY := 1095
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
;每周
stdTargetX := 878 - del
stdTargetY := 612
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [769 - del]
stdCkptY := [600]
desiredColor := ["0x0CC8F4"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "进入每周礼包页面失败!"
ExitApp
}
}
stdTargetX := 212
stdTargetY := 1095
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
;每月
stdTargetX := 1211 - del
stdTargetY := 612
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [1114 - del]
stdCkptY := [600]
desiredColor := ["0x0CC8F4"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "进入每月礼包页面失败!"
ExitApp
}
}
stdTargetX := 212
stdTargetY := 1095
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
;回到大厅
stdTargetX := 333
stdTargetY := 2041
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [64]
stdCkptY := [470]
desiredColor := ["0xFAA72C"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "退出付费商店失败!"
ExitApp
}
}
}
;=============================================================
;3: 免费商店
BuyThisBook(coor, k)
{
uX := Round(coor[1] * k)
uY := Round(coor[2] * k)
uC := PixelGetColor(uX, uY)
R := Format("{:d}", "0x" . substr(uC, 3, 2))
G := Format("{:d}", "0x" . substr(uC, 5, 2))
B := Format("{:d}", "0x" . substr(uC, 7, 2))
if B > G and B > R {
return isCheckedBook[2]
}
if G > R and G > B {
return isCheckedBook[3]
}
if R > G and G > B and G > Format("{:d}", "0x50") {
return isCheckedBook[5]
}
if R > B and B > G and B > Format("{:d}", "0x50") {
return isCheckedBook[4]
}
return isCheckedBook[1]
}
FreeShop(numOfBook)
{
;进入商店
stdTargetX := 1193
stdTargetY := 1487
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [118]
stdCkptY := [908]
desiredColor := ["0xF99217"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
if A_Index > waitTolerance {
MsgBox "进入普通商店失败!"
ExitApp
}
}
;如果今天没白嫖过
stdCkptX := [349]
stdCkptY := [1305]
desiredColor := ["0x127CD7"]
if !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
;白嫖第一次
stdTargetX := 383
stdTargetY := 1480
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [2063]
stdCkptY := [1821]
desiredColor := ["0x079FE4"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "普通商店白嫖异常!"
ExitApp
}
}
stdTargetX := 2100
stdTargetY := 1821
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [118]
stdCkptY := [908]
desiredColor := ["0xF99217"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "普通商店白嫖异常!"
ExitApp
}
}
;如果还有免费次数,则白嫖第二次
stdCkptX := [697]
stdCkptY := [949]
desiredColor := ["0xFB5C24"]
if UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
;刷新
stdTargetX := 476
stdTargetY := 981
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [2133]
stdCkptY := [1345]
desiredColor := ["0x00A0EB"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "普通商店刷新异常!"
ExitApp
}
}
stdTargetX := 2221
stdTargetY := 1351
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [118]
stdCkptY := [908]
desiredColor := ["0xF99217"]
stdTargetX := 588
stdTargetY := 1803
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "普通商店刷新异常!"
ExitApp
}
}
;第二次白嫖
stdTargetX := 383
stdTargetY := 1480
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [2063]
stdCkptY := [1821]
desiredColor := ["0x079FE4"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "普通商店白嫖异常!"
ExitApp
}
}
stdTargetX := 2100
stdTargetY := 1821
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [118]
stdCkptY := [908]
desiredColor := ["0xF99217"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "普通商店白嫖异常!"
ExitApp
}
}
}
}
;废铁商店检查是否已经购买
stdTargetX := 137
stdTargetY := 1737
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [137]
stdCkptY := [1650]
desiredColor := ["0xFB931A"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "废铁商店进入异常!"
ExitApp
}
}
if sleepTime < 1500
Sleep 500
global isBoughtTrash
stdCkptX := [349]
stdCkptY := [1305]
desiredColor := ["0x137CD5"]
if !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
isBoughtTrash := 0
}
else {
isBoughtTrash := 1
}
;如果需要,则购买竞技场商店前三本书
if numOfBook >= 1 or isCheckedCompanyWeapon {
stdTargetX := 134
stdTargetY := 1403
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [134]
stdCkptY := [1316]
desiredColor := ["0xFA9318"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "竞技场商店进入异常!"
ExitApp
}
}
if sleepTime < 1500
Sleep 500
}
if numOfBook >= 1 {
;购买第一本书
;如果今天没买过
stdCkptX := [349]
stdCkptY := [1305]
desiredColor := ["0x127CD7"]
;如果今天没买过
if !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) and BuyThisBook([378, 1210], scrRatio) {
stdTargetX := 384
stdTargetY := 1486
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [2067]
stdCkptY := [1770]
desiredColor := ["0x07A0E4"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "第一本书购买异常!"
ExitApp
}
}
stdTargetX := 2067
stdTargetY := 1770
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [134]
stdCkptY := [1316]
desiredColor := ["0xFA9318"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index >= 2 {
stdTargetX := 2067
stdTargetY := 1970
}
if A_Index > waitTolerance {
MsgBox "第一本书购买异常!"
ExitApp
}
}
}
}
if numOfBook >= 2 {
;购买第二本书
;如果今天没买过
stdCkptX := [673]
stdCkptY := [1305]
desiredColor := ["0x137CD5"]
if !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) and BuyThisBook([702, 1210], scrRatio) {
stdTargetX := 702
stdTargetY := 1484
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [2067]
stdCkptY := [1770]
desiredColor := ["0x07A0E4"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "第二本书购买异常!"
ExitApp
}
}
stdTargetX := 2067
stdTargetY := 1770
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [134]
stdCkptY := [1316]
desiredColor := ["0xFA9318"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index >= 2 {
stdTargetX := 2067
stdTargetY := 1970
}
if A_Index > waitTolerance {
MsgBox "第二本书购买异常!"
ExitApp
}
}
}
}
if numOfBook >= 3 {
;购买第三本书
;如果今天没买过
stdCkptX := [997]
stdCkptY := [1304]
desiredColor := ["0x147BD4"]
if !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) and BuyThisBook([1025, 1210], scrRatio) {
stdTargetX := 1030
stdTargetY := 1485
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [2067]
stdCkptY := [1770]
desiredColor := ["0x07A0E4"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index > waitTolerance {
MsgBox "第三本书购买异常!"
ExitApp
}
}
stdTargetX := 2067
stdTargetY := 1770
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime
stdCkptX := [134]
stdCkptY := [1316]
desiredColor := ["0xFA9318"]
while !UserCheckColor(stdCkptX, stdCkptY, desiredColor, scrRatio) {
UserClick(stdTargetX, stdTargetY, scrRatio)
Sleep sleepTime // 2
if A_Index >= 2 {
stdTargetX := 2067
stdTargetY := 1970
}