forked from Unponderable/NGU-Rebirth-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMasterScript.ahk
3992 lines (3548 loc) · 96.6 KB
/
MasterScript.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
;MasterScript
;Written by Unponderable and Tatsumasa.
;Check the README for setup instructions.
;Settings can be changed when you run the script. Mess with stuff below at your own risk.
;PRO TIP: Use Blaze's junkyard spreadsheet from #help-and-info in the NGU Discord to help figure out what Wandoos version/Augments you should be running.
;Optimality may change depending on the challenge type or run duration.
;-------
Global defRebirthTimeSetting
Global defLoopOption
Global defLoopOptionValue
Global defMaxAdventureZone
Global defMaxSustainableBloodSpellNumber
Global defWandoosVersion
Global defOptimalAugmentation
Global defChallenge1RunIterations
Global defChallenge1RunLength
Global defChallenge2RunIterations
Global defChallenge2RunLength
Global defChallenge3RunIterations
Global defChallenge3RunLength
Global defEnableNGUs
Global defNGU_Augments
Global defNGU_Wandoos
Global defNGU_Respawn
Global defNGU_Gold
Global defNGU_Adventure
Global defNGU_PowerAlpha
Global defNGU_DropChance
Global defNGU_MagicNGU
Global defNGU_PP
Global defNGU_Yggdrasil
Global defNGU_EXP
Global defNGU_PowerBeta
Global defNGU_Number
Global defNGU_TimeMachine
Global defNGU_EnergyNGU
Global defNGU_AdventureBeta
Global defDigger_1
Global defDigger_2
Global defDigger_3
Global defDigger_4
Global defDigger_5
Global defDigger_6
Global defDigger_7
Global defDigger_8
Global defDigger_9
Global defDigger_10
Global defDigger_11
Global defDigger_12
Global EquipLoadout3ForMoneyPit
Global DoNotSave
Global DoubleBasicTrainingPerk
Global AlwaysCap
Global BackgroundMode
Global ImageSearchVariance
Global RebirthTimeSetting := defRebirthTimeSetting
Global MaxAdventureZone := defMaxAdventureZone
Global MaxSustainableBloodSpellNumber := defMaxSustainableBloodSpellNumber
Global WandoosVersion := defWandoosVersion
Global OptimalAugmentation := defOptimalAugmentation
Global Challenge1RunIterations := defChallenge1RunIterations
Global Challenge1RunLength := defChallenge1RunLength
Global Challenge2RunIterations := defChallenge2RunIterations
Global Challenge2RunLength := defChallenge2RunLength
Global Challenge3RunIterations := defChallenge3RunIterations
Global Challenge3RunLength := defChallenge3RunLength
Global EnableNGUs := defEnableNGUs
Global defEnergyNGU := [defNGU_Augments,defNGU_Wandoos,defNGU_Respawn,defNGU_Gold,defNGU_Adventure,defNGU_PowerAlpha,defNGU_DropChance,defNGU_MagicNGU,defNGU_PP]
Global EnergyNGU := defEnergyNGU
for index in EnergyNGU
{
ENGU%index% := EnergyNGU[index]
}
Global defMagicNGU := [defNGU_Yggdrasil,defNGU_EXP,defNGU_PowerBeta,defNGU_Number,defNGU_TimeMachine,defNGU_EnergyNGU,defNGU_AdventureBeta]
Global MagicNGU := defMagicNGU
for index in MagicNGU
{
MNGU%index% := MagicNGU[index]
}
Global defDiggers :=[defDigger_1,defDigger_2,defDigger_3,defDigger_4,defDigger_5,defDigger_6,defDigger_7,defDigger_8,defDigger_9,defDigger_10,defDigger_11,defDigger_12]
Global DiggerLoadout := defDiggers
for index in DiggerLoadout
{
Digger%index% := defDiggers[index]
}
CoordMode, Mouse, Client
CoordMode, Pixel, Client
CoordMode, Tooltip, Client
Global Stop
Global OverallTimerStart
Global OverallTimerTime
Global SegmentTimerStart
Global SegmentTimerTime
Global LastSegmentTimerTime
Global SegmentTime
Global RebirthTimerStart
Global RebirthTimerTime
Global LastRebirthTimerTime
Global RebirthTime
Global WalderpTimerStart
Global WalderpTimerTime
Global PixelDiff
Global Counter
Global TempX
Global TempY
Global CurrentStep
Global Completions
Global Rebirths
Global Search1X
Global Search1Y
Global Search2X
Global Search2Y
Global SearchFileName
Global SleepStatus
Global CurrentStatus
Global ChallengeFlag
Global TransformFlag
Global TopLeftX = 0
Global TopLeftY = 0
Global WindowId = 0
Global MainMenuX := 221 ;main menu ("FEATURES") X coordinate
Global FightBossMainY := 42
Global MoneyPitMainY := 72
Global AdventureMainY := 102
Global InventoryMainY := 132
Global AugmentationMainY := 152
Global AdvTrainingMainY := 182
Global TimeMachineMainY := 212
Global BloodMagicMainY := 242
Global WandoosMainY := 272
Global NGUMainY := 302
Global YGGMainY := 332
Global DiggersMainY := 352
Global HacksY := 428
Global SelloutMainY := 507
Global ConfirmX := 755 - 329
Global ConfirmY := 640 - 323
Global SaveX := 370 - 329
Global SaveY := 805 - 323
Global CustomInput1X := 363
Global CustomInput2X := 467
Global CapX := 673
Global 2X := 703
Global 4X := 739
Global CustomPercent1X := 761
Global CustomPercent2X := 797
Global Idle2X := 865
Global Idle4X := 900
Global IdleCustomPercentX := 927
Global EnergyY := 17
Global MagicY := 41
Global R3Y := 69
Global RebirthMainX := 400 - 329
Global RebirthMainY := 735 - 323
Global RebirthX := 865 - 329
Global ChallengeX := 1030 - 329
Global RebirthBothY := 840 - 323
Global BasicY := 505 - 323
Global ChallengeMenuX := 710 - 329
Global 24HCY := 565 - 323
Global NECY := 625 - 323
Global BlindY := 745 - 323
Global FightX := 626
Global NukeY := 150
Global FightY := 280
Global StopY := 215
Global MoneyPitX := 428
Global MoneyPitY := 168
Global DailySpinMenuX := 824
Global DailySpinMenuY := 240
Global DailySpinX = 1045 - 329
Global DailySpinY = 880 - 323
Global AdventureLeftArrowX := 645 - 329
Global AdventureRightArrowX := 1255 - 329
Global AdventureArrowY := 211
Global ITOPODX := 725 - 329
Global ITOPODY := 555 - 323
Global ITOPODConfirmX := 955 - 329
Global ITOPODConfirmY := 620 - 323
Global ITOPODOptimalX := 1020 - 329
Global ITOPODOptimalY := 533 - 323
Global InventoryX := 670 - 329
Global InventoryY := 650 - 323
Global InventoryPagesX := 680 - 329
Global InventoryPagesY := 890 - 323
Global LoadoutX := 650 - 329
Global LoadoutY := 580 - 323
Global WeaponX := 895 - 329
Global CubeX := 945 - 329
Global WeaponCubeY := 435 - 323
Global Acces1X := 745 - 329
Global Acces2X := 795 - 329
Global Acces3Y := 485 - 323
Global Acces4Y := 535 - 323
Global AugmentationPlusX := 860 - 329
Global Scissors1Y := 585 - 323
Global Scissors2Y := 615 - 323
Global Milk1Y := 645 - 323
Global Milk2Y := 675 - 323
Global Cannon1Y := 710 - 323
Global Cannon2Y := 740 - 323
Global Shoulder1Y := 775 - 323
Global Shoulder2Y := 805 - 323
Global Buster1Y := 840 - 323
Global Buster2Y := 870 - 323
Global Exo1Y := 447
Global Exo2Y := 477
Global LaserSword1Y := 511
Global LaserSword2Y := 541
Global AugBBX := 515
Global AugScrollBarX := 945
Global AugScrollBarTopY := 257
Global AugScrollBarBottomY := 567
Global AugScrollStatus := "unknown"
Global AdvTrainingPlusX := 1210 - 329
Global AdvTrainingBothY := 550 - 323
Global TimeMachinePlusX := 850 - 329
Global TimeMachineEnergyY := 550 - 323
Global TimeMachineMagicY := 650 - 323
Global TimeMachineEnergyBBX := 507
Global TimeMachineEnergyBBY := 231
Global TimeMachineMagicBBY := 331
Global BloodMagicPlusX := 815 - 329
Global BloodMagicCapX := 890 - 329
Global BloodMagicY := 550 - 323
Global BloodMagicSpellsX := 710 - 329
Global BloodMagicSpellsY := 435 - 323
Global CastBloodMagicSpellsX1 := 660 - 329
Global CastBloodMagicSpellsY1 := 540 - 323
Global CastBloodMagicSpellsCheckX1 := 840 - 329
Global CastBloodMagicSpellsX2 := 1000 - 329
Global CastBloodMagicSpellsY2 := 606 - 301
Global CastBloodMagicSpellsCheckX2 := 1178 - 329
Global CastBloodMagicSpellsY3 := 734 - 301
Global WandoosPlusX := 875 - 329
Global WandoosCapX := 945 - 329
Global WandoosEnergyY := 570 - 323
Global WandoosMagicY := 670 - 323
Global WandoosCheckX := 645 - 329
Global Wandoos98Y := 740 - 323
Global WandoosMEHY := 765 - 323
Global WandoosXLY := 790 - 323
Global NGUBothPlusX := 845 - 329
Global NGUBothY := 565 - 323
Global NGUToMagicX := 695 - 329
Global NGUToMagicY := 445 - 323
Global NGUCapX := 620
Global NGUCapY := 160
Global YGGButtonsX := 1150 - 329
Global YGGMaxY := 770 - 323
Global YGGAllY := 810 - 323
Global DiggersPageX := 660 - 329
Global DiggersPageY := 435 - 323
Global DiggersLeftCapX := 870 - 329
Global DiggersRightCapX := 1185 - 329
Global DiggersTopCapY := 510 - 323
Global DiggersBottomCapY := 700 - 323
Global DiggersLeftActiveX := 660 - 329
Global DiggersRightActiveX := 985 - 329
Global DiggersTopActiveY := 565 - 323
Global DiggersBottomActiveY := 755 - 323
Global ChallengeChoice
Global RepeatChoice
Global RunDurationChoice
Global RunDurationChoiceText
Global LoopNumber
Global LoopNumberText
Global AdvZoneChoice
Global BloodSpellChoice
Global WandoosChoice
Global AugChoice
Global ScreenTopLeftX
Global ScreenTopLeftY
Global Nag := 0
Global Boss37Check := 0
Global ChallengeNumber
Global NACFlag := 0
Global 100LFlag := 0
Global NRCFlag := 0
Global NoTMFlag := 0
RunStart()
;^p::StartTest()
SetupOffsets() ; Defines TopLeftX and TopLeftY to be the top-left corner of the game, based on an image search. Run everytime you run a script.
{
IfWinNotActive, Play NGU IDLE ;kong
{
IfWinNotActive, ahk_exe NGUIdle.exe ;kart
{
MsgBox, Failed to initiate - NGU Idle window not active.`nRun the script when the game window is active.
Exit
}
}
WinGet, WindowId, ID, A
WinGetPos,,,WinW,WinH
IfWinNotActive, ahk_exe NGUIdle.exe ;kart
{
SearchFileName = TopLeft.png
ImageSearch, SearchX, SearchY, 0, 0, %WinW%, %WinH%, *%ImageSearchVariance% %SearchFileName%
If SearchX
{
TopLeftX := SearchX
TopLeftY := SearchY
;MsgBox %TopLeftX% %TopLeftY%
}
else
{
MsgBox, Failed to initiate - NGU Idle game not fully visible or can't find TopLeft.png on screen.`nCheck the FAQ.
;MsgBox,%WinW% %WinH%
Exit
}
}
IfWinActive, ahk_exe NGUIdle.exe ;kart
{
TopLeftX := 0
TopLeftY := 0
}
if (BackgroundMode = 1)
{
ScreenTopLeftX := TopLeftX
ScreenTopLeftY := TopLeftY
WinGet, WindowId, ID, A
global WindowId := WindowId
CoordMode, Mouse, Screen ; We need coordmode set to screen because imagesearch doesn't work with inactive windows
CoordMode, Pixel, Screen
CoordMode, Tooltip, Screen
WinGetPos,X1,Y1,XWid,YWid
X2:=X1+XWid
Y2:=Y1+YWid
ImageSearch, TopLeftX, TopLeftY, %X1%, %Y1%, %X2%, %Y2%, *%ImageSearchVariance% %SearchFileName%
;MsgBox, %TopLeftX% and %TopLeftY%
}
}
Click2(X,Y,Button:="Left") ;Click2 clicks at X, Y _relative to the game_. Requires SetupOffsets() to have already been called once. Can also specify right-click, a-click, d-click, and Ctrl-click.
{
if (BackgroundMode = 0)
{
;MsgBox, %X% %Y% %Button%
WinActivate, Play NGU IDLE ;kong
WinActivate, ahk_exe NGUIdle.exe ;kart
X += TopLeftX
Y += TopLeftY
if (Button = "Left")
{
Click,%X%,%Y%
}
else if (Button = "Right")
{
Click,right,%X%,%Y%
}
else if (Button = "a")
{
Send {a down}{Click, %X%,%Y%}{a up}
}
else if (Button = "d")
{
Send {d down}{Click, %X%,%Y%}{d up}
}
else if (Button = "Ctrl")
{
Send ^{Click, %X%,%Y%}
}
}
else
{
X += ScreenTopLeftX
Y += ScreenTopLeftY
Sleep, 100
PostMessage, 0x200, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_MOUSEMOVE
Sleep, 100
if (Button = "Left") {
PostMessage, 0x201, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONDOWN
Sleep, 100
PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONUP
}
else if (Button = "Right") {
PostMessage, 0x204, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_RBUTTONDOWN
Sleep, 100
PostMessage, 0x205, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_RBUTTONUP
}
else if (Button = "a")
{
PostMessage, 0x100, 0x41,,, ahk_id %WindowId% ; key down
Sleep, 100
PostMessage, 0x201, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONDOWN
Sleep, 50
PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONUP
Sleep, 50
PostMessage, 0x101, 0x41,,, ahk_id %WindowId% ; key up
}
else if (Button = "d")
{
PostMessage, 0x100, 0x44,,, ahk_id %WindowId% ; key down
Sleep, 100
PostMessage, 0x201, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONDOWN
Sleep, 50
PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONUP
Sleep, 50
PostMessage, 0x101, 0x44,,, ahk_id %WindowId% ; key up
}
else if (Button = "Ctrl")
{
PostMessage, 0x100, 0x11,,, ahk_id %WindowId% ; key down
Sleep, 100
PostMessage, 0x201, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONDOWN
Sleep, 50
PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %WindowId% ; WM_LBUTTONUP
Sleep, 50
PostMessage, 0x101, 0x11,,, ahk_id %WindowId% ; key up
}
}
}
Send2(inp)
{
if (BackgroundMode = 0)
{
WinActivate, Play NGU IDLE ;kong
WinActivate, ahk_exe NGUIdle.exe ;kart
send, %inp%
}
else
{
StringLower, inp, inp
if (inp = "{shift down}")
{
PostMessage, 0x100, 0x10,,, ahk_id %WindowId% ; key down
}
else if (inp = "{shift up}")
{
PostMessage, 0x101, 0x10,,, ahk_id %WindowId% ; key up
}
else if (inp = "ctrl down")
{
PostMessage, 0x100, 0x11,,, ahk_id %WindowId%
}
else if (inp = "ctrl up")
{
PostMessage, 0x101, 0x11,,, ahk_id %WindowId%
}
else if (inp = "{left}")
{
PostMessage, 0x100, 0x25,,, ahk_id %WindowId%
Sleep 100
PostMessage, 0x101, 0x25,,, ahk_id %WindowId%
}
else if (inp = "{right}")
{
PostMessage, 0x100, 0x27,,, ahk_id %WindowId%
Sleep 100
PostMessage, 0x101, 0x27,,, ahk_id %WindowId%
}
else if (inp = "{d down}")
{
PostMessage, 0x100, 0x44,,, ahk_id %WindowId%
}
else if (inp = "{d up}")
{
PostMessage, 0x101, 0x44,,, ahk_id %WindowId%
}
else if (inp = "{a down}")
{
PostMessage, 0x100, 0x41,,, ahk_id %WindowId%
}
else if (inp = "{a up}")
{
PostMessage, 0x101, 0x41,,, ahk_id %WindowId%
}
else if (Button = "{R}")
{
PostMessage, 0x100, 0x52,,, ahk_id %WindowId% ; key down
sleep, 100
PostMessage, 0x101, 0x52,,, ahk_id %WindowId% ; key up
}
else if (Button = "{T}")
{
PostMessage, 0x100, 0x54,,, ahk_id %WindowId% ; key down
sleep, 100
PostMessage, 0x101, 0x54,,, ahk_id %WindowId% ; key up
}
else if (Button = "{Esc}")
{
PostMessage, 0x100, 0x1B,,, ahk_id %WindowId% ; key down
sleep, 100
PostMessage, 0x101, 0x1B,,, ahk_id %WindowId% ; key up
}
else if (Button = "{Enter}")
{
PostMessage, 0x100, 0x0D,,, ahk_id %WindowId% ; key down
sleep, 100
PostMessage, 0x101, 0x0D,,, ahk_id %WindowId% ; key up
}
else
{
chars := {"a": 0x41, "b": 0x42, "c": 0x43, "d": 0x44, "e": 0x45, "f": 0x46, "g": 0x47, "h": 0x48
, "i": 0x49, "j": 0x4A, "k": 0x4B, "l": 0x4C, "m": 0x4D, "n": 0x4E, "o": 0x4F, "p": 0x50, "q": 0x51
, "r": 0x52, "s": 0x53, "t": 0x54, "u": 0x55, "v": 0x56, "w": 0x57, "x": 0x58, "y": 0x59, "z": 0x5A
, " ": 0x20}
numbers := {0: 0x30, 1: 0x31, 2: 0x32, 3: 0x33, 4: 0x34, 5: 0x35, 6: 0x36, 7: 0x37, 8: 0x38, 9: 0x39}
Loop, parse, str
{
if (chars[A_LoopField])
{
while (GetKeyState("Control") || GetKeyState("Alt")) ; safeguard from sending ctrl/alt to the game
{
Sleep, 10
}
PostMessage, 0x100, % chars[A_LoopField],,, ahk_id %WindowId% ; key down
PostMessage, 0x101, % chars[A_LoopField],,, ahk_id %WindowId% ; key up
}
else ; numbers only require key up event
{
while (GetKeyState("Control") || GetKeyState("Alt"))
{
Sleep, 10
}
PostMessage, 0x101, % numbers[A_LoopField],,, ahk_id %WindowId% ; key up
}
}
}
}
}
PixelGetColor2(X,Y)
{
X += TopLeftX
Y += TopLeftY
;MsgBox,%X% %Y%
PixelGetColor, value, %X%, %Y%
return value
}
Timer() ; Sets up a tooltip at ToolTipX and ToolTipY to display what's going on in the script.
{
ToolTipX := 5
ToolTipY := 105
OverallTimerTime := A_TickCount - OverallTimerStart
OverallYear := 2016
OverallYear += Floor (OverallTimerTime / 1000), SECONDS
FormatTime, OverallTime, %OverallYear%, HH:mm:ss
SegmentTimerTime := A_TickCount - SegmentTimerStart
SegmentYear := 2016
SegmentYear += Floor (SegmentTimerTime / 1000), SECONDS
FormatTime, SegmentTime, %SegmentYear%, HH:mm:ss
LastSegmentYear := 2016
LastSegmentYear += Floor (LastSegmentTimerTime / 1000), SECONDS
FormatTime, LastSegmentTime, %LastSegmentYear%, HH:mm:ss
WalderpTimerTime := A_TickCount - WalderpTimerStart
WalderpYear := 2016
WalderpYear += Floor (WalderpTimerTime / 1000), SECONDS
FormatTime, WalderpTime, %WalderpYear%, HH:mm:ss
RebirthTimerTime := A_TickCount - RebirthTimerStart
RebirthYear := 2016
RebirthYear += Floor (RebirthTimerTime / 1000), SECONDS
FormatTime, RebirthTime, %RebirthYear%, HH:mm:ss
LastRebirthYear := 2016
LastRebirthYear += Floor (LastRebirthTimerTime / 1000), SECONDS
FormatTime, LastRebirthTime, %LastRebirthYear%, HH:mm:ss
IfWinActive, Play NGU IDLE ;kong
ToolTip, Diagnostic Tooltip`n`nOverall Time: %OverallTime%`nCurrent Status: %CurrentStatus%`nRebirth Time: %RebirthTime%`nLast RebirthTime: %LastRebirthTime%`nLast Rebirth Milli: %LastRebirthTimerTime%`nCurrent Function: %CurrentStep%`n`nStats:`n# of Completions: %Completions%`n`nEsc: Quit`nF12: Pause/Unpause, ToolTipX, ToolTipY
IfWinActive, ahk_exe NGUIdle.exe ;kart
ToolTip, Diagnostic Tooltip`n`nOverall Time: %OverallTime%`nCurrent Status: %CurrentStatus%`nRebirth Time: %RebirthTime%`nLast RebirthTime: %LastRebirthTime%`nFunction: %CurrentStep%`n`nStats:`n# of Completions: %Completions%`n`nEsc: Quit`nF12: Pause/Unpause, 0, 0
Else
ToolTip
}
;====Confirm and Save=====
Confirm() ; Clicks the confirm button that pops up when trying to take certain actions.
{
CurrentStep := A_ThisFunc
Click2(ConfirmX, ConfirmY)
Sleep 500
}
Save() ; Clicks the save button.
{
if DoNotSave = 1
{
return
}
CurrentStep := A_ThisFunc
Click2(SaveX, SaveY)
Sleep 500
IfWinActive, Save Yer Game
{
Send2("{Enter}")
Sleep,500
}
}
;====Energy Selection====
Energy2X() ; Clicks the 1/2 Idle Energy Button
{
CurrentStep := A_ThisFunc
Click2(Idle2X, EnergyY)
Sleep 500
}
Energy4X() ; Clicks the 1/4 Idle Energy Button
{
CurrentStep := A_ThisFunc
Click2(Idle4X, EnergyY)
Sleep 500
}
EnergyMax() ; Clicks the Max Energy Button
{
CurrentStep := A_ThisFunc
Click2(CapX, EnergyY)
Sleep 500
}
EnergyCustom1() ; Clicks the 1st Custom Energy Button
{
CurrentStep := A_ThisFunc
Click2(CustomInput1X, MagicY)
Sleep 500
}
EnergyCustom1Set(X) ;Sets Custom Energy Button 1 to be X
{
CurrentStep := A_ThisFunc
Click2(CustomInput2X,EnergyY)
Sleep 500
Send2(%X%)
Sleep 500
Send2("{Shift down}")
Sleep 500
Click2(CustomInput1X, MagicY)
Sleep 500
Send2("{Shift up}")
Sleep 500
}
EnergyCustom2() ; Clicks the 2nd Custom Energy Button
{
CurrentStep := A_ThisFunc
Click2(CustomInput2X, MagicY)
Sleep 500
}
EnergyCustom2Set(X) ;Sets Custom Energy Button 2 to be X. NOT USED
{
CurrentStep := A_ThisFunc
Click2(CustomInput2X,EnergyY)
Sleep 500
Send2(%X%)
Sleep 500
Send2("{Shift down}")
Sleep 500
Click2(CustomInput2X, MagicY)
Sleep 500
Send2("{Shift up}")
Sleep 500
}
EnergyPercent1() ; Clicks the 1st Custom Percent Energy Button
{
CurrentStep := A_ThisFunc
Click2(CustomPercent1X, EnergyY)
Sleep 500
}
EnergyCustomPercent1Set(X) ;Sets Custom Energy Percent Button 1 to be X.
{
CurrentStep := A_ThisFunc
Click2(CustomInput2X,EnergyY)
Sleep 500
Send2(%X%)
Sleep 500
Send2("{Shift down}")
Sleep 500
Click2(CustomPercent1X, EnergyY)
Sleep 500
Send2("{Shift up}")
Sleep 500
}
EnergyPercent2() ; Clicks the 2nd Custom Percent Energy Button
{
CurrentStep := A_ThisFunc
Click2(CustomPercent2X, EnergyY)
Sleep 500
}
EnergyCustomIdlePercent() ;Clicks on the Custom Idle Energy % button. Requires AP purchase
{
CurrentStep := A_ThisFunc
Click2(IdleCustomPercentX, EnergyY)
Sleep 500
}
EnergyCustomIdlePercentSet(X) ;Sets Custom Idle Energy % Button to be X.
{
CurrentStep := A_ThisFunc
Click2(CustomInput2X,EnergyY)
Sleep 500
Send2(%X%)
Sleep 500
Send2("{Shift down}")
Sleep 500
Click2(IdleCustomPercentX, EnergyY)
Sleep 500
Send2("{Shift up}")
Sleep 500
}
;====Magic Selection====
Magic2X() ; Clicks the 1/2 Idle Magic Button
{
CurrentStep := A_ThisFunc
Click2(Idle2X, MagicY)
Sleep 500
}
Magic4X() ; Clicks the 1/4 Idle Magic Button
{
CurrentStep := A_ThisFunc
Click2(Idle4X, MagicY)
Sleep 500
}
MagicPercent1() ; Clicks the 1st Custom Percent Magic Button
{
CurrentStep := A_ThisFunc
Click2(CustomPercent1X, MagicY)
Sleep 500
}
MagicCustomPercent1Set(X) ;Sets Custom Magic Percent Button 1 to be X.
{
CurrentStep := A_ThisFunc
Click2(CustomInput2X,EnergyY)
Sleep 500
Send2("%X%")
Sleep 500
Send2("{Shift down}")
Sleep 500
Click2(CustomPercent1X, MagicY)
Sleep 500
Send2("{Shift up}")
Sleep 500
}
MagicPercent2() ; Clicks the 2nd Custom Percent Magic Button
{
CurrentStep := A_ThisFunc
Click2(CustomPercent2X, MagicY)
Sleep 500
}
MagicMax() ; Clicks the Max Magic Button
{
CurrentStep := A_ThisFunc
Click2(CapX, MagicY)
Sleep 500
}
MagicCustomIdlePercent() ;Clicks on the Custom Magic Energy % button. Requires AP purchase
{
CurrentStep := A_ThisFunc
Click2(IdleCustomPercentX, MagicY)
Sleep 500
}
MagicCustomIdlePercentSet(X) ;Sets Custom Idle Magic % Button to be X.
{
CurrentStep := A_ThisFunc
Click2(CustomInput2X,EnergyY)
Sleep 500
Send2(%X%)
Sleep 500
Send2("{Shift down}")
Sleep 500
Click2(IdleCustomPercentX, MagicY)
Sleep 500
Send2("{Shift up}")
Sleep 500
}
RegainEnergy() ; Presses R to regain all energy when not on Adventure screen
{
CurrentStep := A_ThisFunc
Send2("{R}")
Sleep 500
}
RegainMagic() ; Presses T to regain all magic when not on Adventure screen
{
CurrentStep := A_ThisFunc
Send2("{T}")
Sleep 500
}
RegainBoth() ; Presses R and T to regain all energy and magic when not on Adventure screen
{
CurrentStep := A_ThisFunc
Send2("{R}")
Sleep 500
Send2("{T}")
Sleep 500
}
;====Rebirth and Challenges====
RebirthMenu() ; Clicks on the Rebirth button (on the left side menu)
{
CurrentStep := A_ThisFunc
Click2(RebirthMainX, RebirthMainY)
Sleep 500
}
Rebirth() ; Clicks on the Rebith button (inside the Rebirth Menu)
{
CurrentStep := A_ThisFunc
Click2(RebirthX, RebirthBothY)
Sleep 500
RebirthTimerStart := A_TickCount
Confirm()
}
ChallengeMenu() ; Clicks on the Challenges button (inside the Rebirth Menu)
{
CurrentStep := A_ThisFunc
Click2(ChallengeX, RebirthBothY)
Sleep 500
}
24HCStart() ; Clicks on the 24-Hour Challenge button (inside the Challenges Menu) - legacy support option
{
ChallengeStart(2)
}
ChallengeStart(ChallengeNumber) ;Clicks on the Challenge specified. ChallengeNumber=1 == Basic, and so on.
{
CurrentStep := A_ThisFunc
ChallengeFlag := 1
PixelDiff := 30
TempY := BasicY + PixelDiff * (ChallengeNumber - 1)
Click2(ChallengeMenuX, TempY)
Sleep 500
RebirthTimerStart := A_TickCount
Confirm()
}
;====Fight Boss====
FightMenu() ; Clicks on the Fight Boss menu
{
CurrentStep := A_ThisFunc
Click2(MainMenuX, FightBossMainY)
Sleep 500
}
NukeBoss() ; Clicks on the Nuke Button (in the Fight Boss menu)
{
CurrentStep := A_ThisFunc
Click2(FightX, NukeY)
Sleep 500
}
FightBoss() ; Clicks on the Fight Button (in the Fight Boss menu)
{
CurrentStep := A_ThisFunc
Click2(FightX, FightY)
Sleep 500
}
StopFight() ; Clicks on the Stop Button (in the Fight Boss menu)
{
CurrentStep := A_ThisFunc
Click2(FightX, StopY)
Sleep 500
}
;====Money Pit and Daily Spin====
MoneyPitMenu() ; Clicks on the Money Pit menu
{
CurrentStep := A_ThisFunc
Click2(MainMenuX, MoneyPitMainY)
Sleep 500
}
DailySpinMenu() ; Clicks on the Daily Spin button (inside the Money Pit menu)
{
CurrentStep := A_ThisFunc
Click2(DailySpinMenuX, DailySpinMenuY)
Sleep 500
}
MoneyPit() ; Clicks on the Money Pit (inside the Money Pit menu)
{
CurrentStep := A_ThisFunc
Click2(MoneyPitX, MoneyPitY)
Sleep 500
Confirm()
}
DailySpin() ; Clicks on the "No BS, just gimme the prize" button inside the Daily Spin menu.
{
CurrentStep := A_ThisFunc
Click2(DailySpinX, DailySpinY)
Sleep 500
}
;====Adventure====
AdventureMenu() ; Clicks on the Adventure Menu
{
CurrentStep := A_ThisFunc