forked from dice4321/Gunkolle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gunkolle.ahk.bak
1492 lines (1405 loc) · 37.9 KB
/
Gunkolle.ahk.bak
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
;Gunkolle v0.5.0
#Persistent
#SingleInstance
#Include %A_ScriptDir%/Functions/Gdip_All.ahk ;Thanks to tic (Tariq Porter) for his GDI+ Library => ahkscript.org/boards/viewtopic.php?t=6517
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}
CoordMode, Pixel, Relative
Menu, Tray, Icon, %A_ScriptDir%/Icons/favicon_ahkcsortie.ico,,1
IniRead, Background, config.ini, Variables, Background, 1
IniRead, Class, config.ini, Variables, Class, 0
Initialize()
IniRead, WINID, config.ini, Variables, WINID, Nox
MiscDelay := 1000
;PixelColor Constants
#Include %A_ScriptDir%/Constants/PixelColor.ahk
BC := 0
BusyS := 0
TR := 0
DT := 0
Nodes := 1
Sortiecount := 0
StartTime := A_TickCount
IniRead, NotificationLevel, config.ini, Variables, NotificationLevel, 1
IniRead, TWinX, config.ini, Variables, LastXS, 0
IniRead, TWinY, config.ini, Variables, LastYS, 0
SpecificWindows()
IniRead, MinRandomWait, config.ini, Variables, MinRandomWaitS, 0
IniRead, MaxRandomWait, config.ini, Variables, MaxRandomWaitS, 300000
IniRead, Doll1, config.ini, Variables, Doll1, AR15
IniRead, Doll2, config.ini, Variables, Doll2, M4A1
IniRead, Doll3, config.ini, Variables, Doll3
IniRead, Doll4, config.ini, Variables, Doll4
IniRead, WeaponType, config.ini, Variables, WeaponType, AssaultRifle
IniRead, ProductionTdoll, config.ini, Variables, ProductionTdoll, 0
IniRead, ProductionEquipment, config.ini, Variables, ProductionEquipment, 0
IniRead, Enhancement, config.ini, Variables, Enhancement, 0
; IniRead, DisassembleCycle, config.ini, Variables, DisassembleCycle, 3
IniRead, FriendCollector, config.ini, Variables, FriendCollector, 0
IniRead, BatteryCollector, config.ini, Variables, BatteryCollector, 0
IniRead, CombatSimsData, config.ini, Variables, CombatSimsData, 0
IniRead, SortieInterval, config.ini, Variables, SortieInterval, -1 ;900000 for full morale
IniRead, WorldV, config.ini, Variables, WorldSwitcher
Gui, 1: New
Gui, 1: Default
Gui, Add, Text,, Map:
Gui, Add, Text,, MinWait:
Gui, Add, Text,, MaxWait:
Gui, Add, Edit, r1 w20 vNB ReadOnly
GuiControl, Move, NB, x10 w300 y80
Gui, Add, DDL, x40 w60 ym-3 vWorldV, |4_3E|6_3N|0_2|2_6|3_6|4_6|5_6|6_6|BOSS_RUN|5_4_friendly|
GuiControl, ChooseString, WorldV, %WorldV%
; Gui, Add, Edit, gWorldF r2 limit3 w10 vWorldV -VScroll ym, %World%
; GuiControl, Move, WorldV, x37 h17 w15
; Gui, Add, Text, x55 ym, -
; Gui, Add, Edit, gMapF r2 limit3 w10 vMapV -VScroll ym, %Map%
; GuiControl, Move, MapV, x62 h17 w20
Gui, Add, Text, ym, Interval(ms):
Gui, Add, Edit, gIntervalF r2 w15 vIntervalV -VScroll ym, %SortieInterval%
GuiControl, Move, IntervalV, h17 w70
Gui, Add, Checkbox, vExpeditionV , Expedition only
GuiControl, Move, ExpeditionV, x150 y33
Gui, Add, Checkbox, vcorpsedragoffV , Corpse dragging off
GuiControl, Move, corpsedragoffV, x150 y58
; Gui, Add, Text, vText, #Nodes
; GuiControl, Move, Text, x150 y35
; Gui, Add, Edit, gNodeCount r2 limit3 w10 vNodeCount -VScroll ym, %Nodes%
; GuiControl, Move, NodeCount, x195 y33 h17 w25
Gui, Add, Button, gSSBF vSSB, A
GuiControl, Move, SSB, x250 w60 ym
GuiControl,,SSB, Start
Gui, Add, Edit, gMiW r2 w20 vmid -VScroll, %MinRandomWait%
GuiControl, Move, mid, h20 x60 y30 w80
Gui, Add, Edit, gMaW r2 w20 vmad -VScroll, %MaxRandomWait%
GuiControl, Move, mad, h20 x60 y55 w80
Menu, Main, Add, Pause, Pause2
Menu, Main, Add, 0, DN
Gui, Menu, Main
Gui, Show, X%TWinX% Y%TWinY% Autosize, Gunkolle v0.5.0
Gui -AlwaysOnTop
Gui +AlwaysOnTop
SetWindow()
if DisableCriticalCheck = 1
{
GuiControl,, NB, Ready - WARNING: CRITICAL CHECK IS OFF
}
return
;TODO
; need new click function specifically for nodes
;pass in values with 'o' wait for 5-10 Seconds
; while !found
; if not found within 5 seconds, start from 'o parameter' count up every second until 30 seconds
; if not found within 30 seconds, activate 'expedition search'
; while found
; keep clicking until !found
;
; Random
; Or
; find img
; click img til gone.
RFindClick(x,y,v*)
{
local RandX, RandY := v[1], radius := 5, counter := 0
Random, OutX, -1.0, 1.0
Random, Sign, -1.0, 1.0
RandY += Round((sqrt(1 - OutX ** 2) * radius * Sign))
RandX += Round((OutX * radius))
GuiControl,, NB, %x%
Found := 0
while (Found == 0)
{
Found := FindClick(A_ScriptDir "\pics\" x,y " Center x"RandX " y"RandY " n0 count1")
if(Found == 0)
{
FindClick(A_ScriptDir "\pics\ExpeditionArrive", "rNoxPlayer mc o50 Count1")
FindClick(A_ScriptDir "\pics\ExpeditionConfirm", "rNoxPlayer mc o40 Count1")
}
else
{
FindClick(A_ScriptDir "\pics\" x,y "Center x"RandX " y"RandY)
previousImg := x
previousParameters := y
}
if(counter == 1)
{
FindClick(A_ScriptDir "\pics\" previousImg,previousParameters "Center x"RandX " y"RandY "w5000,50")
}
counter++
}
return
}
; Wait incremental
WFindClick(x,y,SearchNumber := 40)
{
local RandX, RandY, radius := 5
Random, OutX, -1.0, 1.0
Random, Sign, -1.0, 1.0
RandY += Round((sqrt(1 - OutX ** 2) * radius * Sign))
RandX += Round((OutX * radius))
GuiControl,, NB, %x%
Found := 0
Found := FindClick(A_ScriptDir "\pics\" x,y " rNoxPlayer mc o"SearchNumber " dtop n0")
while (found == 0)
{
SearchNumber:= SearchNumber + 6
Found := FindClick(A_ScriptDir "\pics\" x,y " rNoxPlayer mc o"SearchNumber " n0")
GuiControl,, NB, pixel shade offset [%SearchNumber%]
if (SearchNumber >= 200)
{
GuiControl,, NB, Could not find %x%, exit and redo config.
Pause
SearchNumber := 0
}
}
GuiControl,, NB, pixel shade offset [%SearchNumber%]
FindClick(A_ScriptDir "\pics\" x, y "Center x" RandX " y" RandY " o" SearchNumber)
previousImg := x
}
NoStopFindClick(x,y,v*)
{
local RandX, RandY := v[1], radius := 5, looper := 1
Random, OutX, -1.0, 1.0
Random, Sign, -1.0, 1.0
RandY += Round((sqrt(1 - OutX ** 2) * radius * Sign))
RandX += Round((OutX * radius))
GuiControl,, NB, %x%
Found := FindClick(A_ScriptDir "\pics\" x,y " Center x"RandX " y"RandY " n0 count1")
Found2:= FindClick(A_ScriptDir "\pics\ExpeditionArrive", "rNoxPlayer mc o50 Center x"RandX " y"RandY " n0 Count1")
loop, %looper%
{
if (Found == 1)
{
RSleep(MinRandomWait, MaxRandomWait)
FindClick(A_ScriptDir "\pics\" x,y "Center x"RandX " y"RandY)
return 1
}
if (Found2 == 1)
{
while(Found3 != 1)
{
FindClick(A_ScriptDir "\pics\ExpeditionArrive", "rNoxPlayer mc o50 Center x"RandX " y"RandY "Count1")
Found3 := FindClick(A_ScriptDir "\pics\ExpeditionConfirm", "rNoxPlayer mc o40 Center x"RandX " y"RandY "Count1")
}
looper +=1
}
}
}
ClickTilGone(x,y,v*)
{
local RandX, RandY := v[1], radius := 5
Random, OutX, -1.0, 1.0
Random, Sign, -1.0, 1.0
RandY += Round((sqrt(1 - OutX ** 2) * radius * Sign))
RandX += Round((OutX * radius))
GuiControl,, NB, %x%
Found := FindClick(A_ScriptDir "\pics\" x,y " count1 Center x"RandX " y"RandY)
While (Found == 1)
{
FindClick(A_ScriptDir "\pics\" x,y "Center x"RandX " y"RandY " w1,1")
Found := FindClick(A_ScriptDir "\pics\" x,y " n0 count1 w1,1")
count += 1
if(found != 1)
{
break
}
}
}
TFindClick(ClickThis,WaitForThis,v*)
{
local RandX, RandY := v[1], radius := 5
Random, OutX, -1.0, 1.0
Random, Sign, -1.0, 1.0
RandY += Round((sqrt(1 - OutX ** 2) * radius * Sign))
RandX += Round((OutX * radius))
Found := FindClick(A_ScriptDir "\pics\" WaitForThis, "rNoxPlayer mc o30 Count1 n0")
GuiControl,, NB, %ClickThis%
While (Found == 0)
{
FindClick(A_ScriptDir "\pics\"ClickThis, "rNoxPlayer mc o30 Center x"RandX " y"RandY)
Found := FindClick(A_ScriptDir "\pics\" WaitForThis, " rNoxPlayer mc o30 Count1 n0 w500,50")
GuiControl,, NB, Waiting for [%WaitForThis%]
}
}
Transition(ClickThis,WaitForThis)
{
Global
local RandX, RandY, radius := 5
local Counter
Random, OutX, -1.0, 1.0
Random, Sign, -1.0, 1.0
RandY += Round((sqrt(1 - OutX ** 2) * radius * Sign))
RandX += Round((OutX * radius))
FormatTime, TimeString,% A_NowUTC, HHmm
Found := FindClick(A_ScriptDir "\pics\" WaitForThis, "rNoxPlayer mc o40 Count1 n0")
While (Found == 0)
{
FindClick(A_ScriptDir "\pics\ExpeditionArrive", "rNoxPlayer mc o50 Center x"RandX " y"RandY)
FindClick(A_ScriptDir "\pics\ExpeditionConfirm", "rNoxPlayer mc o40 Center x"RandX " y"RandY)
FindClick(A_ScriptDir "\pics\"ClickThis, "rNoxPlayer mc o30 Center x"RandX " y"RandY)
Found := FindClick(A_ScriptDir "\pics\" WaitForThis, " rNoxPlayer mc o40 Count1 n0 w500,50")
Found2:= FindClick(A_ScriptDir "\pics\MissionAccompished", "rNoxPlayer mc o40 Count1 n0")
GuiControl,, NB, Waiting for [%WaitForThis%] | loop counter == %Counter%
Counter++
if ((Counter >= 20) && (Found == 0))
{
Counter = 0
ExpeditionCheck("daily")
}
if (Found2 == true)
{
FoundHome = 0
While (FoundHome != true)
{
ClickS(Expeditionx,Expeditiony)
FoundHome := FindClick(A_ScriptDir "\pics\WaitForHome", "rNoxPlayer mc o30 w1000,50 Count1 n0 a1200,,,-600")
}
}
}
}
ExpeditionCheck(State := "")
{
global
loop,1
{
if (State == "Daily")
{
FormatTime, TimeString,% A_NowUTC, HHmm
GuiControl,, NB, %TimeString%
if ((TimeString <= 0755) || (TimeString >= 0810)){
break
}
}
GuiControl,, NB, ExpeditionCheck running
loopcount := 1
while (loopcount != 0)
{
pc := [HPC]
tpc := WaitForPixelColor(Homex,Homey,pc,,,5)
tpc := 0
sleep 3000
pc := []
pc := [HPC,ExpeditionReceived1,ExpeditionReceived2,Androidpopup0,Androidpopup1,LoginCollect,LoginCollectNotice]
tpc := WaitForPixelColor(Homex,Homey,pc,,,5)
if tpc = 1
{
GuiControl,, NB,At home
}
else if or tpc = 2 or tpc = 3
{
GuiControl,, NB, Expedition Found
pc := []
pc := [HPC]
WaitForPixelColor(Homex,Homey,pc,Expeditionx,Expeditiony,30)
loopcount++
}
else if tpc = 4 or tpc = 5
{
GuiControl,, NB, Android popup Found
ClickS(AndroidpopupExitx,AndroidpopupExity)
loopcount++
}
else if tpc = 6
{
GuiControl,, NB, Login Collect Found
ClickS(LoginCollectExitx,LoginCollectExity)
loopcount++
}
else if tpc = 7
{
GuiControl,, NB, Login Collect Notice
ClickS(LoginCollectNoticey,LoginCollectNoticey)
loopcount++
}
Else
{
GuiControl,, NB, Initial Event notice Found
ClickS(Dailypopx,Dailypopy)
loopcount++
}
loopcount--
}
}
; Found := FindClick(A_ScriptDir "\pics\Home", "rNoxPlayer mc o50 Count1 n0")
; while( Found == 0 )
; {
; ExpeditionCheck()
; Found := FindClick(A_ScriptDir "\pics\Home", "rNoxPlayer mc o50 Count1 n0")
; }
return
}
UpdateEnergy()
{
global
FindClick(A_ScriptDir "\pics\CombatSims\Data\DataModeClicked", "rNoxPlayer mc o30 Count1 w15000,50 n0")
EnergyCount = 0
FoundEnergy := FindClick(A_ScriptDir "\pics\CombatSims\Data\Energy0", "rNoxPlayer mc o30 Count1 w1000,50 n0")
While (FoundEnergy != true) {
EnergyCount++
FoundEnergy := FindClick(A_ScriptDir "\pics\CombatSims\Data\Energy" EnergyCount, "rNoxPlayer mc o30 Count1 n0")
}
GuiControl,, NB, EnergyCount == %EnergyCount% CombatSimsData == %CombatSimsData%
return EnergyCount
}
TimeCheck()
{
global
; global FriendCollector
; global FriendChecker
; global BatteryCollector
; global BatteryChecker
FormatTime, TimeString, %A_NowUTC%, HHmm
FormatTime, someday, %A_NowUTC%, ddd
GuiControl,, NB, %TimeString%
if (FriendCollector == 1) && (FriendChecker == 1)
{
if TimeString between 1100 and 1415
{
FriendChecker--
Random, FriendTime, 3000000, 3600000
SetTimer, FriendFlag, %Friendtime%
RFindClick("Dorm\Dorm", "rNoxPlayer mc o30 w30000,50")
RFindClick("Dorm\Visit", "rNoxPlayer mc o30 w30000,50")
sleep 100
RFindClick("Dorm\MyFriends", "rNoxPlayer mc o30 w30000,50")
sleep 250
RFindClick("Dorm\VisitDorm", "rNoxPlayer mc o30 w30000,50")
RFindClick("Dorm\WaitForFriends", "rNoxPlayer mc o30 w30000,50 n0")
FoundMessage := 0
FoundMessage := FindClick(A_ScriptDir "\pics\Dorm\Message", "rNoxPlayer mc o30 count1 n0")
while (FoundMessage == 0)
{
RFindClick("Dorm\Like", "rNoxPlayer mc o30 w30000,50")
sleep 500
Found := FindClick(A_ScriptDir "\pics\Dorm\Battery", "rNoxPlayer mc o30 count1 n0")
if (Found == 1)
{
RFindClick("Dorm\Battery", "rNoxPlayer mc o30 w30000,50")
RFindClick("Dorm\BatteryClose", "rNoxPlayer mc o30 w30000,50")
}
RFindClick("Dorm\Next", "rNoxPlayer mc o30 w30000,50")
sleep 1000
RFindClick("Dorm\WaitForFriends", "rNoxPlayer mc o30 w30000,50 n0")
sleep 200
FoundMessage := FindClick(A_ScriptDir "\pics\Dorm\Message", "rNoxPlayer mc o30 count1 n0 ")
}
RFindClick("Dorm\Return", "rNoxPlayer mc o30 w30000,50")
RFindClick("Dorm\Exit", "rNoxPlayer mc o30 w30000,50")
ExpeditionCheck()
}
}
if ((BatteryCollector == 1) && (BatteryChecker == 1))
{
if TimeString between 1900 and 2200
{
BatteryChecker--
Random, BatteryTime, 3000000, 3600000
SetTimer, BatteryFlag, %BatteryTime%
Clicks(Dormx,Dormy)
pc := [DormVisitButton]
WaitForPixelColor(DormVisitButtonx,DormVisitButtony,pc,,,30)
sleep 5000
Clicks(Batteryx,Batteryy)
pc := [HPC]
WaitForPixelColor(Homex,Homey,pc,AndroidpopupExitx,AndroidpopupExity,30)
}
}
if (((CombatSimsData >= 1) && (CombatSimsDataChecker == 1)))
{
if (((RegExMatch(someday, "Sun|Tue|Fri") && (TimeString >= 0800 && TimeString <= 2400)) || (RegExMatch(someday, "Mon|Wed|Sat") && (TimeString >= 0000 && TimeString <= 0800))))
{
CombatSimsDataChecker--
Random, CombatSimsDataTime, 3600000, 3650000
SetTimer, CombatSimsDataFlag, %CombatSimsDataTime%
Transition("Combat","CombatPage")
NoStopFindClick("CombatSims\Data\CombatSims", "rNoxPlayer mc o30 w1000,50")
NoStopFindClick("CombatSims\Data\Training1", "rNoxPlayer mc o30 Count1 w30000,50 n0")
Found := FindClick(A_ScriptDir "\pics\CombatSims\Data\DataModeClicked", "rNoxPlayer mc o30 Count1 n0 w2000")
if (Found != True){
RFindClick("CombatSims\Data\DataMode", "rNoxPlayer mc o30 w2000,50")
}
EnergyCount := UpdateEnergy()
While (EnergyCount >= CombatSimsData) {
EnergyCount := UpdateEnergy()
loop,3 {
if ((EnergyCount >= CombatSimsData) && (CombatSimsData == A_Index)) {
RFindClick("CombatSims\Data\Training" A_Index, "rNoxPlayer mc o30 Count1 w5000,50")
RFindClick("CombatSims\Data\EnterCombat", "rNoxPlayer mc o30 w5000,50")
RFindClick("CombatSims\Data\Confirm", "rNoxPlayer mc o30 w5000,50")
;needs a better wait here; perhaps the yellow combat loading screen
sleep 5000
Found := 0
While (Found != true) {
ClickS(Homex,Homey)
Found := FindClick(A_ScriptDir "\pics\CombatSims\Data\DataModeClicked", "rNoxPlayer mc o30 Count1 w2000,50 n0")
}
EnergyCount := UpdateEnergy()
sleep 2000
}
}
}
GoHome()
}
}
}
Production()
{
Global
while (FindClick(A_ScriptDir "\pics\WaitForHome", "rNoxPlayer mc o30 Count1 n0 a1200,,,-600") != 1)
{
sleep 1000
ClickS(Expeditionx,Expeditiony)
}
Found := FindClick(A_ScriptDir "\pics\Production\FactoryReady", "rNoxPlayer mc o30 n0 count1 a1000,300,,-300")
GuiControl,, NB, Found something at production.
if ((ProductionTdoll == 1 || ProductionEquipment == 1) && Found == 1)
{
Transition("Production\FactoryReady","Production\WaitForTdollProduction")
if (ProductionTdoll == 1)
{
FoundSlot1 := FindClick(A_ScriptDir "\pics\Production\TdollProductionComplete1", "rNoxPlayer mc o30 n0 count1 w2000,50")
FoundSlot2 := FindClick(A_ScriptDir "\pics\Production\TdollProductionComplete2", "rNoxPlayer mc o30 n0 count1")
FoundSlot3 := FindClick(A_ScriptDir "\pics\Production\TdollProductionComplete3", "rNoxPlayer mc o30 n0 count1")
loop,3
{
ProductionCounter := A_Index
if (FoundSlot%A_Index% == 1)
{
RFindClick("Production\TdollProductionComplete"A_Index, "rNoxPlayer mc o30 w30000,50")
Loop
{
if ( FindClick(A_ScriptDir "\pics\Production\TdollProductionStart"ProductionCounter, "rNoxPlayer mc o50 n0 count1") == 1 )
{
break
}
Else
{
ClickS(Safex,Safey)
sleep 500
}
}
RFindClick("Production\TdollProductionStart"A_Index, "rNoxPlayer mc o50 w30000,50")
RFindClick("Production\StartProduction", "rNoxPlayer mc o50 w30000,50")
sleep 1000
}
}
}
RFindClick("Production\WaitForTdollProduction", "rNoxPlayer mc o50 w30000,50 n0")
Found := FindClick(A_ScriptDir "\pics\Production\EquipmentReady", "rNoxPlayer mc o50 count1 n0 w2000,50")
if ( Found == 1)
{
RFindClick("Production\EquipmentReady", "rNoxPlayer mc o50 w30000,50")
RFindClick("Production\WaitForTdollProduction", "rNoxPlayer mc o50 w30000,50 n0")
FoundSlot1 := FindClick(A_ScriptDir "\pics\Production\EquipmentSlotComplete1", "rNoxPlayer mc o50 n0 count1 w2000,50")
FoundSlot2 := FindClick(A_ScriptDir "\pics\Production\EquipmentSlotComplete2", "rNoxPlayer mc o50 n0 count1")
FoundSlot3 := FindClick(A_ScriptDir "\pics\Production\EquipmentSlotComplete3", "rNoxPlayer mc o50 n0 count1")
loop,3
{
ProductionCounter := A_Index
if (FoundSlot%A_Index% == 1)
{
RFindClick("Production\EquipmentSlotComplete"A_Index, "rNoxPlayer mc o50 w30000,50")
Loop
{
if ( FindClick(A_ScriptDir "\pics\Production\EquipmentSlotStart"ProductionCounter, "rNoxPlayer mc o50 n0 count1") == 1 )
{
break
}
Else
{
ClickS(Safex,Safey)
sleep 500
}
}
if ( ProductionEquipment == 1)
{
RFindClick("Production\EquipmentSlotStart"A_Index, "rNoxPlayer mc o50 w30000,50")
RFindClick("Production\StartProduction", "rNoxPlayer mc o50 w30000,50")
sleep 1000
}
}
}
}
sleep 1000
RFindClick("FactoryReturn", "rNoxPlayer mc o50 w30000,50")
}
}
Repair()
{
Global
while (FindClick(A_ScriptDir "\pics\WaitForHome", "rNoxPlayer mc o30 Count1 n0 a1200,,,-600") != 1)
{
GuiControl,, NB, An expedition is returning, retrying every 1
sleep 1000
ClickS(Expeditionx,Expeditiony)
}
Found := 0
Found := FindClick(A_ScriptDir "\pics\Repair", "rNoxPlayer mc o50 w500,50 Count1 n0 a800,200,-200,-400")
if ( Found >= 1)
{
Transition("Repair","RepairSlot")
RFindClick("RepairSlot", "rNoxPlayer mc o50 w30000,50 a50,100,-1050,-100")
RFindClick("RepairSlotWait", "rNoxPlayer mc o30 w30000,50 n0 a0,100,-1000,-300")
sleep 250
WFindClick("Damage", "rNoxPlayer mc")
RFindClick("OK", "rNoxPlayer mc o50 w30000,50")
RFindClick("RepairQuick", "rNoxPlayer mc o50 w30000,50")
RFindClick("RepairOK", "rNoxPlayer mc o50 w30000,50")
RFindClick("RepairReturnFaded", "rNoxPlayer mc o50 w30000,50 ")
RFindClick("RepairReturn", "rNoxPlayer mc o50 w30000,50")
ExpeditionCheck("Daily")
}
}
RSleep(min,max)
{
Random, rtime, min, max
Sleep, %rtime%
return
}
ReplaceDPS(exhaustedDoll, loadedDoll, resetFilter:=False)
{
Global
WFindClick("DollList\"%exhaustedDoll%, "rNoxPlayer mc a125,125,-590,-220",120) ; select Doll1
if resetFilter
{
RFindClick("FilterYellow", "rNoxPlayer mc o20 w30000,50")
RFindClick("FilterReset", "rNoxPlayer mc o20 w30000,50")
}
if %loadedDoll% in %5Star%
{
RFindClick("Filter_Level", "rNoxPlayer mc o50 w30000,50") ; select Sort by
RFindClick("Filter_More", "rNoxPlayer mc o50 w30000,50") ; select More
RFindClick("Filter_Night Vision", "rNoxPlayer mc o50 w30000,50") ; select Night vision
RFindClick("Filter", "rNoxPlayer mc o50 w30000,50") ; select filter
RFindClick("5STAR", "rNoxPlayer mc o50 w10000,50") ;go to formation
}
Else
{
RFindClick("Filter_Level", "rNoxPlayer mc o50 w30000,50") ; select Sort by
RFindClick("Filter_More", "rNoxPlayer mc o50 w30000,50") ; select More
RFindClick("Filter_Night Vision", "rNoxPlayer mc o50 w30000,50") ; select Night vision
RFindClick("Filter", "rNoxPlayer mc o50 w30000,50") ; select filter
RFindClick("4STAR", "rNoxPlayer mc o50 w10000,50") ;go to formation
}
RFindClick("Filter"WeaponType, "rNoxPlayer mc o50 w30000,50")
RFindClick("Confirm", "rNoxPlayer mc o50 w30000,50")
ClickTilGone("ProfileWait","rNoxPlayer mc o50 w30000,50 n0")
WFindClick("DollList\"%loadedDoll% "Profile","rNoxPlayer mc a,130,-200,",120)
RFindClick("WaitForFormation", "rNoxPlayer mc o50 w30000,50 n0")
}
AddToSecondEchelon(doll, slot)
{
Global
RFindClick("WaitForFormation", "rNoxPlayer mc o50 w30000,50 n0") ;wait for formation
Found := 0
while(Found == 0)
{
if (slot == 1)
{
ClickS(Role1x,Role1y)
}
else if (slot == 2)
{
ClickS(Role2x,Role1y)
}
Found = FindClick(A_ScriptDir "\pics\FilterYellow", "rNoxPlayer mc o20 w30000,50 n0 count1")
}
RFindClick("FilterYellow", "rNoxPlayer mc o20 w30000,50")
RFindClick("FilterReset", "rNoxPlayer mc o20 w30000,50")
RFindClick("Filter", "rNoxPlayer mc o20 w30000,50")
if %doll% in %5Star%
{
RFindClick("5STAR", "rNoxPlayer mc o50 w10000,50")
}
else
{
RFindClick("4STAR", "rNoxPlayer mc o50 w10000,50")
}
RFindClick("Filter"WeaponType, "rNoxPlayer mc o50 w30000,50")
RFindClick("Confirm", "rNoxPlayer mc o50 w30000,50")
ClickTilGone("ProfileWait","rNoxPlayer mc o50 w30000,50 n0")
WFindClick("DollList\"%doll% "Profile", "rNoxPlayer mc",120) ; select Dollportrait1
}
Delay:
{
IniRead, Busy, config.ini, Do Not Modify, Busy, 0
if DT = 0
{
DT := 1
Random, SR, MinRandomWait, MaxRandomWait
QTS := A_TickCount
QTL := SR
SetTimer, NBUpdate, 2000
tSS := MS2HMS(GetRemainingTime(QTS,QTL))
Notify("AHKCSortie", "Starting sortie in " . tSS,1)
Sleep SR
goto Delay
}
else if (Busy = 0 and BusyS = 0)
{
{
goto Sortie2
}
}
else
{
if (Busy = 1 and BusyS = 0)
{
GuiControl,, NB, An expedition is returning, retrying every 10 seconds
SetTimer, NBUpdate, Off
}
SetTimer, Delay, 10000
}
return
}
Sortie2:
{
SetTimer, NBUpdate, Off
SetTimer, Delay, Off
BusyS := 1
DT := 0
TR := 0
GuiControl, Hide, SSB
CheckWindow()
Notify("AHKCSortie", "Preparing to send sortie",1)
; Notify("AHKCSortie", "Sortie started",1)
; if SortieInterval != -1
; {
; SetTimer, Delay, %SortieInterval%
; TR := 1
; TCS := A_TickCount
; }
; NC := 1
;expedition might return here
if SortieInterval != -1
{
SetTimer, Delay, %SortieInterval%
TR := 1
TCS := A_TickCount
}
GuiControlGet, ExpeditionV
GuiControl,, NB, %ExpeditionV%
While (ExpeditionV == 1)
{
GuiControlGet, ExpeditionV
GuiControl,, NB, %ExpeditionV%
GuiControl,, NB, At home [Expedition only]
ExpeditionCheck()
if ( FactoryChecker == 1)
{
Random, Factorytime, 250000, 300000
SetTimer, FactoryFlag, %Factorytime%
FactoryChecker--
}
GuiControl,, NB, FactoryFlag %FactoryFlag%
sleep 1000
if ( FactoryFlag == 1)
{
clickS(Factoryx,Factoryy)
sleep 5000
pc := [HPC]
tpc := WaitForPixelColor(Homex,Homey,pc,FactoryReturnx,FactoryReturny,10)
FactoryFlag--
}
Production()
}
Repair()
TimeCheck()
; if A_Hour between 9 and 11 ; if between 9am and 12pm
; {
; Loop
; {
; GuiControl,, NB, %ExpeditionV%
; GuiControl,, NB, At home [Expedition only]
; ExpeditionCheck()
; sleep 5000
; if A_Hour not between 9 and 11
; {
; break
; }
; }
; }
; Check expedition
GuiControlGet, corpsedragoffV
if (corpsedragoffV != 1)
{
dualDPS := (Doll3 != "ERROR") and (Doll4 != "ERROR")
if (Mod(Sortiecount, 2) == 0)
{
exhaustedDoll1 = Doll1
loadedDoll1 = Doll2
exhaustedDoll2 = Doll3
loadedDoll2 = Doll4
}
else
{
exhaustedDoll1 = Doll2
loadedDoll1 = Doll1
exhaustedDoll2 = Doll4
loadedDoll2 = Doll3
}
Found := 0
Transition("Formation","WaitForFormation")
ReplaceDPS(exhaustedDoll1, loadedDoll1)
if (dualDPS)
{
sleep 500
ReplaceDPS(exhaustedDoll2, loadedDoll2, True)
}
TFindClick("Echelon2","Echelon2Clicked")
AddToSecondEchelon(exhaustedDoll1, 1)
if (dualDPS)
{
sleep 500
AddToSecondEchelon(exhaustedDoll2, 2)
}
Transition("FormationReturn","WaitForHome")
; Check expedition
}
ExpeditionCheck("Daily")
Transition("Combat","CombatPage")
GuiControlGet, WorldV
RunMap(WorldV)
if (Mod(Sortiecount, 2) == 0) {
IniWrite,%Doll2%,config.ini,Variables,Doll1
IniWrite,%Doll1%,config.ini,Variables,Doll2
IniWrite,%Doll4%,config.ini,Variables,Doll3
IniWrite,%Doll3%,config.ini,Variables,Doll4
}
Else {
IniWrite,%Doll1%,config.ini,Variables,Doll1
IniWrite,%Doll2%,config.ini,Variables,Doll2
IniWrite,%Doll3%,config.ini,Variables,Doll3
IniWrite,%Doll4%,config.ini,Variables,Doll4
}
GuiControl,, NB, At home
; Check expedition
ExpeditionCheck("Daily")
; Found := FindClick(A_ScriptDir "\pics\Home", "rNoxPlayer mc o50 Count1 n0 w5000,50")
Sortiecount++
ti := BC+1
Menu, Main, Rename, %BC%, %ti%
BC += 1
; check productions
Production()
GuiControl,, NB, Idle
BusyS := 0
GuiControl, Show, SSB
if SortieInterval != -1
{
BP := 0
SetTimer, NBUpdate, 2000
}
return
}
; Sortie:
; {
; SetTimer, NBUpdate, Off
; SetTimer, Delay, Off
; BusyS := 1
; DT := 0
; TR := 0
; GuiControl, Hide, SSB
; CheckWindow()
; Notify("AHKCSortie", "Preparing to send sortie",1)
; ; tpc := PixelGetColorS(FX,FY,3)
; ; GuiControl,, NB, Color is %tpc%
; ; sleep 2000
; ; GuiControl,, NB, HPC is %HPC%
; ; sleep 2000
; ; if (tpc = HPC)
; ; {
; ; GuiControl,, NB, Color is tpc = HPC
; ; sleep 2000
; ; }
; ; loop, 6
; ; {
; ; GuiControl,, NB, Checking HP %A_Index%
; ; tpc := PixelGetColorS(ShipHealthx,ShipHealthy[A_Index],3)
; ; GuiControl,, NB, Color is %tpc%
; ; if (tpc = RedHealthPC)
; ; {
; ; GuiControl,, NB, RED detected
; ; if (world !=1 and map != 1)
; ; {
; ; NC := Nodes
; ; }
; ; }
; ; }
; if not (BP = 1 and DisableCriticalCheck = 1)
; {
; if not (world = 1 and map = 1)
; {
; Repair()
; }
; }
; if not (BP = 1 and DisableResupply = 1)
; {
; Resupply(1)
; }
; tpc2 := PixelGetColorS(Gx,Gy,3)
; if (tpc2 != HPC)
; {
; ClickS(Hx,Hy)
; GuiControl,, NB, Waiting for home screen
; pc := []
; pc := [HPC]
; WaitForPixelColor(Gx,Gy,pc)
; }
; ClickS(Sx,Sy)
; GuiControl,, NB, Waiting for sortie screen
; pc := []
; pc := [SPC]
; WaitForPixelColor(Gx,Gy,pc)
; ClickS(S2x,S2y)
; GuiControl,, NB, Waiting for sortie selection screen
; pc := []
; pc := [S2PC]
; WaitForPixelColor(Gx,Gy,pc)
; tf := SPGx[World]
; Sleep MiscDelay
; ClickS(tf,PGy)
; GuiControl,, NB, Starting sortie
; Sleep MiscDelay
; if(Map > 4)
; {
; pc := []
; pc := [PG2SPC]
; tpc := WaitForPixelColor(PGExtrax,PGExtray,pc,Extrax,Extray)
; }
; tfx := MAPx[Map]
; tfy := MAPy[Map]
; ClickS(tfx,tfy)
; Sleep MiscDelay
; ClickS(ESx,ESy)
; Sleep MiscDelay
; ClickS(ESx,ESy)
; Notify("AHKCSortie", "Sortie started",1)
; if SortieInterval != -1
; {
; SetTimer, Delay, %SortieInterval%
; TR := 1
; TCS := A_TickCount
; }
; NC := 1
; Loop
; {
; GuiControl,, NB, Waiting for compass/formation
; pc := []
; pc := [CPC,FPC,IBPC]
; tpc := WaitForPixelColor(LAx,LAy,pc,,,30)
; Sleep MiscDelay
; if tpc = 1
; {
; ClickS(ESx,ESy)
; sleep 1000
; GuiControl,, NB, Waiting for formation
; pc := []
; pc := [FPC,CPC,ResourceSortiePC,IBPC]
; tpc2 := WaitForPixelColor(LAx,LAy,pc,,,30)
; if tpc2 = 1
; {
; Sleep MiscDelay
; if(World = 1 and Map = 5)
; {
; ClickS(LAbreastx,LAbreasty)
; }
; else if(world = 3 and map = 2)
; {
; ClickS(L_doublex,L_doubley)
; }
; else
; {
; ClickS(LAx,LAy)
; }
; }
; else if tpc2 = 2
; {
; ClickS(ESx,ESy)
; GuiControl,, NB, FIRST COMPASS PASSED Waiting for formation
; pc := []
; pc := [FPC,CPC,ResourceSortiePC,IBPC]
; tpc3 := WaitForPixelColor(LAx,LAy,pc,,,30)
; if tpc3 = 1
; {
; Sleep MiscDelay
; if(World = 1 and Map = 5)
; {
; ClickS(LAbreastx,LAbreasty)
; }
; else
; {
; ClickS(LAx,LAy)
; }
; }
; else if tpc3 = 2
; {
; pc := []
; pc := [HPC,HEPC]