forked from mikebaldi/Idle-Champions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModronGUI.ahk
1376 lines (1303 loc) · 50.7 KB
/
ModronGUI.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
#SingleInstance force
;Modron Automation Gem Farming Script
;by mikebaldi1980
global ScriptDate := "11/13/21"
;put together with the help from many different people. thanks for all the help.
SetWorkingDir, %A_ScriptDir%
CoordMode, Mouse, Client
;========================================
;User settings not accessible via the GUI
;========================================
;variables to consider changing if restarts are causing issues
global gOpenProcess := 10000 ;time in milliseconds for your PC to open Idle Champions
global gGetAddress := 5000 ;time in milliseconds after Idle Champions is opened for it to read moduel base address from memory
global ScriptSpeed := 25
;====================
;end of user settings
;====================
/* Changes
"11/13/21"
1. Added redundancy and checks for failed key inputs.
*/
;class and methods for parsing JSON (User details sent back from a server call)
#include JSON.ahk
;wrapper with memory reading functions sourced from: https://github.com/Kalamity/classMemory
#include classMemory.ahk
;Check if you have installed the class correctly.
if (_ClassMemory.__Class != "_ClassMemory")
{
msgbox class memory not correctly installed. Or the (global class) variable "_ClassMemory" has been overwritten
ExitApp
}
;pointer addresses and offsets
#include IC_MemoryFunctions.ahk
;server call functions and variables Included after GUI so chest tabs maybe non optimal way of doing it
#include IC_ServerCallFunctions.ahk
;Thanks ThePuppy for the ini code
;Champions to level with Fkeys
global gFKeys :=
loop, 12
{
IniRead, Seat%A_Index%Toggle, UserSettings.ini, Section1, Seat%A_Index%Toggle
if (Seat%A_Index%Toggle)
{
gFKeys = %gFKeys%{F%A_Index%}
}
}
global gSeatToggle := [Seat1Toggle,Seat2Toggle,Seat3Toggle,Seat4Toggle,Seat5Toggle,Seat6Toggle,Seat7Toggle,Seat8Toggle,Seat9Toggle,Seat10Toggle,Seat11Toggle,Seat12Toggle]
;Continued leveling stop zone
IniRead, ContinuedLeveling, UserSettings.ini, Section1, ContinuedLeveling, 10
global gContinuedLeveling := ContinuedLeveling
;Farm SB stacks after this zone
IniRead, AreaLow, UserSettings.ini, Section1, AreaLow, 30
global gAreaLow := AreaLow
;Lowest zone SB stacks can be farmed on
IniRead, MinStackZone, UserSettings.ini, Section1, MinStackZone, 25
global gMinStackZone := MinStackZone
;Target Haste stacks
IniRead, SBTargetStacks, UserSettings.ini, Section1, SBTargetStacks, 400
global gSBTargetStacks := SBTargetStacks
;Dash wait max time
IniRead, DashSleepTime, UserSettings.ini, Section1, DashSleepTime, 60000
global gDashSleepTime := DashSleepTime
;Hew's ult key
IniRead, HewUlt, UserSettings.ini, Section1, HewUlt, 6
global gHewUlt := HewUlt
;spam ults after initial leveling
IniRead, Ults, UserSettings.ini, Section1, Ults
global gUlts := Ults
;Briv swap to avoid bosses
IniRead, AvoidBosses, UserSettings.ini, Section1, AvoidBosses
global gAvoidBosses := AvoidBosses
;Click damage toggle
IniRead, ClickLeveling, UserSettings.ini, Section1, ClickLeveling
global gClickLeveling := ClickLeveling
;Click damage toggle
IniRead, CtrlClickLeveling, UserSettings.ini, Section1, CtrlClickLeveling, 0
global gCtrlClickLeveling := CtrlClickLeveling
;Stack fail recovery toggle
IniRead, StackFailRecovery, UserSettings.ini, Section1, StackFailRecovery
global gStackFailRecovery := StackFailRecovery
;Stack fail recovery toggle
IniRead, StackFailConvRecovery, UserSettings.ini, Section1, StackFailConvRecovery
global gStackFailConvRecovery := StackFailConvRecovery
;Briv swap sleep time
IniRead, SwapSleep, UserSettings.ini, Section1, SwapSleep, 1500
global gSwapSleep := SwapSleep
;Restart stack sleep time
IniRead, RestartStackTime, UserSettings.ini, Section1, RestartStackTime, 12000
global gRestartStackTime := RestartStackTime
;Intall location
IniRead, GameInstallPath, Usersettings.ini, Section1, GameInstallPath, C:\Program Files (x86)\Steam\steamapps\common\IdleChampions\IdleDragons.exe
global gInstallPath := GameInstallPath
;Normal SB farm max time
IniRead, SBTimeMax, UserSettings.ini, Section1, SBTimeMax, 60000
global gSBTimeMax := SBTimeMax
;Enable servecalls to open chests during stack restart
IniRead, DoChests, UserSettings.ini, Section1, DoChests, 0
global gDoChests := DoChests
;Minimum gems to save when buying chests
IniRead, SCMinGemCount, UserSettings.ini, Section1, SCMinGemCount, 0
global gSCMinGemCount := SCMinGemCount
;Buy silver chests when can afford this many
IniRead, SCBuySilvers, UserSettings.ini, Section1, SCBuySilvers, 0
global gSCBuySilvers := SCBuySilvers
;Open silver chests when you have this many
IniRead, SCSilverCount, UserSettings.ini, Section1, SCSilverCount, 0
global gSCSilverCount := SCSilverCount
;Buy gold chests when can afford this many
IniRead, SCBuyGolds, UserSettings.ini, Section1, SCBuyGolds, 0
global gSCBuyGolds := SCBuyGolds
;Open silver chests when you have this many
IniRead, SCGoldCount, UserSettings.ini, Section1, SCGoldCount, 0
global gSCGoldCount := SCGoldCount
;variable for correctly tracking stats during a failed stack, to prevent fast/slow runs to be thrown off
global gStackFail := 0
;globals for various timers
global gSlowRunTime :=
global gFastRunTime := 100
global gRunStartTime :=
global gTotal_RunCount := 0
global gStartTime :=
global gPrevLevelTime :=
global gPrevRestart :=
global gprevLevel :=
global dtCurrentLevelTime :=
;globals for reset tracking
global gFailedStacking := 0
global gFailedStackConv := 0
;globals used for stat tracking
global gGemStart :=
global gCoreXPStart :=
global gGemSpentStart :=
global gRedGemsStart :=
global gStackCountH :=
global gStackCountSB :=
;define a new gui with tabs and buttons
Gui, MyWindow:New
Gui, MyWindow:+Resize -MaximizeBox
Gui, MyWindow:Add, Button, x415 y25 w60 gSave_Clicked, Save
Gui, MyWindow:Add, Button, x415 y+50 w60 gRun_Clicked, `Run
Gui, MyWindow:Add, Button, x415 y+100 w60 gReload_Clicked, `Reload
Gui, MyWindow:Add, Tab3, x5 y5 w400, Read First|Settings|Help|Stats|Debug|
Gui, Tab, Read First
Gui, MyWindow:Font, w700
Gui, MyWindow:Add, Text, x15 y30, Gem Farm, %ScriptDate%
Gui, MyWindow:Font, w400
Gui, MyWindow:Add, Text, x15 y+10, Instructions:
Gui, MyWindow:Add, Text, x15 y+2 w10, 1.
Gui, MyWindow:Add, Text, x+2 w370, Save your speed formation in formation save slot 1, in game `hotkey "Q". This formation must include Briv and at least one familiar on the field.
Gui, MyWindow:Add, Text, x15 y+2 w10, 2.
Gui, MyWindow:Add, Text, x+2 w370, Save your stack farming formation in formation save slot 2, in game `hotkey "W". Don't include any familiars on the field.
Gui, MyWindow:Add, Text, x15 y+2 w10, 3.
Gui, MyWindow:Add, Text, x+2 w370, Save your speed formation without Briv, Hew, or Melf in formation save slot 3, in game `hotkey "E".
Gui, MyWindow:Add, Text, x15 y+2, 4. Adjust the settings on the settings tab.
Gui, MyWindow:Add, Text, x15 y+2, 5. `Click the save button to save your settings.
Gui, MyWindow:Add, Text, x15 y+2, 6. Load into zone 1 of an adventure to farm gems.
Gui, MyWindow:Add, Text, x15 y+2, 7. Press the run button to start farming gems.
Gui, MyWindow:Add, Text, x15 y+10, Notes:
Gui, MyWindow:Add, Text, x15 y+2, 1. Use the pause hotkey, ``, to adjust settings after a run starts.
Gui, MyWindow:Add, Text, x15 y+2, 2. Don't forget to unpause after saving your settings.
Gui, MyWindow:Add, Text, x15 y+2, 3. First run is ignored for stats, in case it is a partial run.
Gui, MyWindow:Add, Text, x15 y+2, 4. Settings save to and load from UserSettings.ini file.
Gui, MyWIndow:Add, Text, x15 y+2 w10, 5.
Gui, MyWIndow:Add, Text, x+2 w370, Recommended SB stack level is [Modron Reset Zone] - X, with X = 4 for single skip, X = 6 for double skip, X = 8 for triple skip, and X = 10 for quadruple skip.
Gui, MyWindow:Add, Text, x15 y+2 w10, 6.
Gui, MyWindow:Add, Text, x+2 w370, Script will activate and focus the game window for manual resets as part of failed stacking.
Gui, MyWIndow:Add, Text, x15 y+2 w10, 7.
Gui, MyWIndow:Add, Text, x+2 w370, Script communicates directly with Idle Champions play servers to recover from a failed stacking and for when Modron resets to the World Map.
Gui, MyWIndow:Add, Text, x15 y+2 w10, 8.
Gui, MyWIndow:Add, Text, x+2 w370, Script reads system memory.
Gui, MyWIndow:Add, Text, x15 y+2 w10, 9.
Gui, MyWIndow:Add, Text, x+2 w370, Disable manual resets to recover from failed Briv stack conversions when running event free plays.
Gui, MyWIndow:Add, Text, x15 y+2 w10, 10.
Gui, MyWIndow:Add, Text, x+2 w370, Recommended Briv swap `sleep time is betweeb 1500 - 3000. If you are seeing Briv's landing animation then increase the the swap sleep time. If Briv is not back in the formation before monsters can be killed then decrease the swap sleep time.
Gui, MyWindow:Add, Text, x15 y+10, Known Issues:
Gui, MyWindow:Add, Text, x15 y+2, 1. Cannot fully interact with `GUI `while script is running.
Gui, MyWindow:Add, Text, x15 y+2 w10, 2.
Gui, MyWindow:Add, Text, x+2 w370, Using Hew's ult throughout a run with Briv swapping can result in Havi's ult being triggered instead. Consider removing Havi from formation save slot 3, in game `hotkey "E".
Gui, Tab, Settings
Gui, MyWindow:Add, Text, x15 y30 w120, Seats to level with Fkeys:
Loop, 12
{
i := gSeatToggle[A_Index]
if (A_Index = 1)
Gui, MyWindow:Add, Checkbox, vCheckboxSeat%A_Index% Checked%i% x15 y+5 w60, Seat %A_Index%
Else if (A_Index <= 6)
Gui, MyWindow:Add, Checkbox, vCheckboxSeat%A_Index% Checked%i% x+5 w60, Seat %A_Index%
Else if (A_Index = 7)
Gui, MyWindow:Add, Checkbox, vCheckboxSeat%A_Index% Checked%i% x15 y+5 w60, Seat %A_Index%
Else
Gui, MyWindow:Add, Checkbox, vCheckboxSeat%A_Index% Checked%i% x+5 w60, Seat %A_Index%
}
Gui, MyWindow:Add, Edit, vNewContinuedLeveling x15 y+10 w50, % gContinuedLeveling
Gui, MyWindow:Add, Text, x+5, Use Fkey leveling while below this zone
Gui, MyWindow:Add, Edit, vNewgAreaLow x15 y+10 w50, % gAreaLow
Gui, MyWindow:Add, Text, x+5, Farm SB stacks AFTER this zone
Gui, MyWindow:Add, Edit, vNewgMinStackZone x15 y+10 w50, % gMinStackZone
Gui, MyWindow:Add, Text, x+5, Minimum zone Briv can farm SB stacks on
Gui, MyWindow:Add, Edit, vNewSBTargetStacks x15 y+10 w50, % gSBTargetStacks
Gui, MyWindow:Add, Text, x+5, Target Haste stacks for next run
Gui, MyWindow:Add, Edit, vNewgSBTimeMax x15 y+10 w50, % gSBTimeMax
Gui, MyWindow:Add, Text, x+5, Maximum time (ms) script will spend farming SB stacks
Gui, MyWindow:Add, Edit, vNewDashSleepTime x15 y+10 w50, % gDashSleepTime
Gui, MyWindow:Add, Text, x+5, Maximum time (ms) script will wait for Dash (0 disables)
Gui, MyWindow:Add, Edit, vNewHewUlt x15 y+10 w50, % gHewUlt
Gui, MyWindow:Add, Text, x+5, `Hew's ultimate key (0 disables)
Gui, MyWindow:Add, Edit, vNewRestartStackTime x15 y+10 w50, % gRestartStackTime
Gui, MyWindow:Add, Text, x+5, `Time (ms) client remains closed for Briv Restart Stack (0 disables)
Gui, MyWindow:Add, Checkbox, vgUlts Checked%gUlts% x15 y+10, Use ults 2-9 after intial champion leveling
Gui, MyWindow:Add, Edit, vNewSwapSleep x15 y+5 w40, % gSwapSleep
Gui, MyWindow:Add, Text, x+5, Briv swap sleep time (ms)
Gui, MyWindow:Add, Checkbox, vgAvoidBosses Checked%gAvoidBosses% x15 y+10, Swap to 'e' formation when `on boss zones
Gui, MyWindow:Add, Checkbox, vgClickLeveling Checked%gClickLeveling% x15 y+5, `Uncheck `if using a familiar `on `click damage
Gui, MyWindow:Add, Checkbox, vgCtrlClickLeveling Checked%gCtrlClickLeveling% x15 y+5, Enable ctrl (x100) leveling of `click damage
Gui, MyWindow:Add, Checkbox, vgStackFailRecovery Checked%gStackFailRecovery% x15 y+5, Enable manual resets to recover from failed Briv stacking
Gui, MyWindow:Add, Checkbox, vgStackFailConvRecovery Checked%gStackFailConvRecovery% x15 y+5, Enable manual resets to recover from failed Briv stack conversion
Gui, MyWindow:Add, Checkbox, vgDoChests Checked%gDoChests% x15 y+10, Enable server calls to buy and open chests during stack restart
Gui, MyWindow:Add, Edit, vNewSCMinGemCount x15 y+10 w100, % gSCMinGemCount
Gui, MyWindow:Add, Text, x+5, Maintain this many gems when buying chests
Gui, MyWindow:Add, Edit, vNewSCBuySilvers x15 y+10 w50, % gSCBuySilvers
Gui, MyWindow:Add, Text, x+5, When there are sufficient gems, buy this many silver chests
Gui, MyWindow:Add, Edit, vNewSCSilverCount x15 y+10 w50, % gSCSilverCount
Gui, MyWindow:Add, Text, x+5, When there are this many silver chests, open them
Gui, MyWindow:Add, Edit, vNewSCBuyGolds x15 y+10 w50, % gSCBuyGolds
Gui, MyWindow:Add, Text, x+5, When there are sufficient gems, buy this many Gold chests
Gui, MyWindow:Add, Edit, vNewSCGoldCount x15 y+10 w50, % gSCGoldCount
Gui, MyWindow:Add, Text, x+5, When there are this many gold chests, open them
Gui, MyWindow:Add, Button, x15 y+20 gChangeInstallLocation_Clicked, Change Install Path
Gui, Tab, Help
;Gui, MyWindow:Font, w700
Gui, MyWindow:Add, Text, x15 y30, Confirm your settings are saved.
Gui, MyWindow:Add, Text, x15 y+2, 1 = true, yes, or enabled
Gui, MyWindow:Add, Text, x15 y+2, 0 = false, no, or disabled
;Gui, MyWindow:Font, w400
Gui, MyWindow:Add, Text, x15 y+15, Fkeys used for leveling:
Gui, MyWindow:Add, Text, vgFKeysID x+2 w300, % gFKeys
Gui, MyWindow:Add, Text, x15 y+5, Use Fkey leveling while below this zone:
Gui, MyWindow:Add, Text, vgContinuedLevelingID x+2 w200, % gContinuedLeveling
Gui, MyWindow:Add, Text, x15 y+5, Farm SB stacks AFTER this zone:
Gui, MyWindow:Add, Text, vgAreaLowID x+2 w200, % gAreaLow
Gui, MyWindow:Add, Text, x15 y+5, Minimum zone Briv can farm SB stacks on:
Gui, MyWindow:Add, Text, vgMinStackZoneID x+2 w200, % gMinStackZone
Gui, MyWindow:Add, Text, x15 y+5, Target Haste stacks for next run:
Gui, MyWindow:Add, Text, vgSBTargetStacksID x+2 w200, % gSBTargetStacks
Gui, MyWindow:Add, Text, x15 y+5, Max time script will farm SB Stacks normally:
Gui, MyWindow:Add, Text, vgSBTimeMaxID x+2 w200, % gSBTimeMax
Gui, MyWindow:Add, Text, x15 y+5, Maximum time (ms) script will wait for Dash:
Gui, MyWindow:Add, Text, vDashSleepTimeID x+2 w200, % gDashSleepTime
Gui, MyWindow:Add, Text, x15 y+5, Hew's ultimate key:
Gui, MyWindow:Add, Text, vgHewUltID x+2 w200, % gHewUlt
Gui, MyWindow:Add, Text, x15 y+5, Time (ms) client remains closed for Briv Restart Stack:
Gui, MyWindow:Add, Text, vgRestartStackTimeID x+2 w200, % gRestartStackTime
Gui, MyWindow:Add, Text, x15 y+5, Use ults 2-9 after initial champion leveling:
Gui, MyWindow:Add, Text, vgUltsID x+2 w200, % gUlts
Gui, MyWindow:Add, Text, x15 y+5, Briv swap sleep time (ms):
Gui, MyWindow:Add, Text, vgSwapSleepID x+2 w200, % gSwapSleep
Gui, MyWindow:Add, Text, x15 y+5, Swap to 'e' formation when on boss zones:
Gui, MyWindow:Add, Text, vgAvoidBossesID x+2 w200, % gAvoidBosses
Gui, MyWindow:Add, Text, x15 y+5, Using a familiar on click damage:
Gui, MyWindow:Add, Text, vgClickLevelingID x+2 w200, % gClickLeveling
Gui, MyWindow:Add, Text, x15 y+5, Enable ctrl (x100) leveling of `click damage:
Gui, MyWindow:Add, Text, vgCtrlClickLevelingID x+2 w200, % gCtrlClickLeveling
Gui, MyWindow:Add, Text, x15 y+5, Enable manual resets to recover from failed Briv stacking:
Gui, MyWindow:Add, Text, vgStackFailRecoveryID x+2 w200, % gStackFailRecovery
Gui, MyWindow:Add, Text, x15 y+5, Enable manual resets to recover from failed Briv stack conversion:
Gui, MyWindow:Add, Text, vgStackFailConvRecoveryID x+2 w200, % gStackFailConvRecovery
Gui, MyWindow:Add, Text, x15 y+5, Enable server calls to buy and open chests during stack restart:
Gui, MyWindow:Add, Text, vgDoChestsID x+2 w200, % gDoChests
Gui, MyWindow:Add, Text, x15 y+5, Maintain this many gems when buying chests:
Gui, MyWindow:Add, Text, vgSCMinGemCountID x+2 w200, % gSCMinGemCount
Gui, MyWindow:Add, Text, x15 y+5, When there are sufficient gems, buy this many silver chests:
Gui, MyWindow:Add, Text, vgSCBuySilversID x+2 w200, % gSCBuySilvers
Gui, MyWindow:Add, Text, x15 y+5, When there are this many silver chests, open them:
Gui, MyWindow:Add, Text, vgSCSilverCountID x+2 w200, % gSCSilverCount
Gui, MyWindow:Add, Text, x15 y+5, When there are sufficient gems, buy this many gold chests:
Gui, MyWindow:Add, Text, vgSCBuyGoldsID x+2 w200, % gSCBuyGolds
Gui, MyWindow:Add, Text, x15 y+5, When there are this many gold chests, open them:
Gui, MyWindow:Add, Text, vgSCGoldCountID x+2 w200, % gSCGoldCount
Gui, MyWindow:Add, Text, x15 y+5, Install Path:
Gui, MyWindow:Add, Text, vgInstallPathID x15 y+2 w350 r5, %gInstallPath%
Gui, MyWindow:Add, Text, x15 y+15 w375 r5, Still having trouble? Take note of the information on the debug tab and ask for help in the scripting channel on the official discord.
statTabTxtWidth :=
Gui, Tab, Stats
Gui, MyWindow:Font, w700
Gui, MyWindow:Add, Text, x15 y33, Stats updated continuously (mostly):
Gui, MyWindow:Font, w400
Gui, MyWindow:Add, Text, x15 y+10 %statTabTxtWidth%, SB Stack `Count:
Gui, MyWindow:Add, Text, vgStackCountSBID x+2 w50, % gStackCountSB
;Gui, MyWindow:Add, Text, vReadSBStacksID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+2 %statTabTxtWidth%, Haste Stack `Count:
Gui, MyWindow:Add, Text, vgStackCountHID x+2 w50, % gStackCountH
;Gui, MyWindow:Add, Text, vReadHasteStacksID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+10 %statTabTxtWidth%, Current `Run `Time:
Gui, MyWindow:Add, Text, vdtCurrentRunTimeID x+2 w50, % dtCurrentRunTime
Gui, MyWindow:Add, Text, x15 y+2 %statTabTxtWidth%, Total `Run `Time:
Gui, MyWindow:Add, Text, vdtTotalTimeID x+2 w50, % dtTotalTime
Gui, MyWindow:Font, w700
Gui, MyWindow:Add, Text, x15 y+10, Stats updated once per run:
Gui, MyWindow:Font, w400
Gui, MyWindow:Add, Text, x15 y+10 %statTabTxtWidth%, Total `Run `Count:
Gui, MyWindow:Add, Text, vgTotal_RunCountID x+2 w50, % gTotal_RunCount
Gui, MyWindow:Add, Text, x15 y+2 %statTabTxtWidth%, Previous `Run `Time:
Gui, MyWindow:Add, Text, vgPrevRunTimeID x+2 w50, % gPrevRunTime
Gui, MyWindow:Add, Text, x15 y+2 %statTabTxtWidth%, Fastest `Run `Time:
Gui, MyWindow:Add, Text, vgFastRunTimeID x+2 w50,
Gui, MyWindow:Add, Text, x15 y+2 %statTabTxtWidth%, Slowest `Run `Time:
Gui, MyWindow:Add, Text, vgSlowRunTimeID x+2 w50, % gSlowRunTime
Gui, MyWindow:Add, Text, x15 y+2 %statTabTxtWidth%, Avg. `Run `Time:
Gui, MyWindow:Add, Text, vgAvgRunTimeID x+2 w50, % gAvgRunTime
Gui, MyWindow:Add, Text, x15 y+2 %statTabTxtWidth%, Fail `Run `Time:
Gui, MyWindow:Add, Text, vgFailRunTimeID x+2 w50, % gFailRunTime
Gui, MyWindow:Add, Text, x15 y+2 %statTabTxtWidth%, Fail Stack Conversion:
Gui, MyWindow:Add, Text, vgFailedStackConvID x+2 w50, % gFailedStackConv
Gui, MyWindow:Add, Text, x15 y+2 %statTabTxtWidth%, Fail Stacking:
Gui, MyWindow:Add, Text, vgFailedStackingID x+2 w50, % gFailedStacking
Gui, MyWindow:Font, cBlue w700
Gui, MyWindow:Add, Text, x15 y+10 %statTabTxtWidth%, Bosses per hour:
Gui, MyWindow:Add, Text, vgbossesPhrID x+2 w50, % gbossesPhr
Gui, MyWindow:Font, cGreen
Gui, MyWINdow:Add, Text, x15 y+10, Total Gems:
Gui, MyWindow:Add, Text, vGemsTotalID x+2 w50, % GemsTotal
Gui, MyWINdow:Add, Text, x15 y+2, Gems per hour:
Gui, MyWindow:Add, Text, vGemsPhrID x+2 w200, % GemsPhr
Gui, MyWindow:Font, cRed
Gui, MyWINdow:Add, Text, x15 y+10, Total Black Viper Red Gems:
Gui, MyWindow:Add, Text, vRedGemsTotalID x+2 w50, % RedGemsTotal
Gui, MyWINdow:Add, Text, x15 y+2, Red Gems per hour:
Gui, MyWindow:Add, Text, vRedGemsPhrID x+2 w200, % RedGemsPhr
Gui, MyWindow:Font, cDefault w400
Gui, MyWindow:Font, w700
Gui, MyWindow:Add, Text, x15 y+10, `Loop:
Gui, MyWindow:Add, Text, vgLoopID x+2 w200, Not Started
Gui, MyWindow:Font, w400
if (gDoChests)
{
Gui, MyWindow:Font, w700
Gui, MyWindow:Add, Text, x15 y+10 w300, Chest Data:
Gui, MyWindow:Font, w400
Gui, MyWindow:Add, Text, x15 y+5, Starting Gems Spent:
Gui, MyWindow:Add, Text, vgSCRedRubiesSpentStartID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, Starting Silvers Opened:
Gui, MyWindow:Add, Text, vgSCSilversOpenedStartID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, Starting Golds Opened:
Gui, MyWindow:Add, Text, vgSCGoldsOpenedStartID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, Silvers Opened:
Gui, MyWindow:Add, Text, vgSCSilversOpenedID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, Golds Opened:
Gui, MyWindow:Add, Text, vgSCGoldsOpenedID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, Gems Spent:
Gui, MyWindow:Add, Text, vGemsSpentID x+2 w200,
}
Gui, Tab, Debug
Gui, MyWindow:Font, w700
Gui, MyWindow:Add, Text, x15 y35, Timers:
Gui, MyWindow:Font, w400
Gui, MyWindow:Add, Text, x15 y+10, ElapsedTime:
Gui, MyWindow:Add, Text, vElapsedTimeID x+2 w200, % ElapsedTime
Gui, MyWindow:Add, Text, x15 y+2, dtCurrentLevelTime:
Gui, MyWindow:Add, Text, vdtCurrentLevelTimeID x+2 w200, % dtCurrentLevelTime
Gui, MyWindow:Font, w700
Gui, MyWindow:Add, Text, x15 y+15, Memory Reads:
Gui, MyWindow:Font, w400
Gui, MyWindow:Add, Text, x15 y+5, ReadCurrentZone:
Gui, MyWindow:Add, Text, vReadCurrentZoneID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadHighestZone:
Gui, MyWindow:Add, Text, vReadHighestZoneID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadQuestRemaining:
Gui, MyWindow:Add, Text, vReadQuestRemainingID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadTimeScaleMultiplier:
Gui, MyWindow:Add, Text, vReadTimeScaleMultiplierID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadTransitioning:
Gui, MyWindow:Add, Text, vReadTransitioningID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadSBStacks:
Gui, MyWindow:Add, Text, vReadSBStacksID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadHasteStacks:
Gui, MyWindow:Add, Text, vReadHasteStacksID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadResetting:
Gui, MyWindow:Add, Text, vReadResettingID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadUserID:
Gui, MyWindow:Add, Text, vReadUserIDID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadUserHash:
Gui, MyWindow:Add, Text, vReadUserHashID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadScreenWidth:
Gui, MyWindow:Add, Text, vReadScreenWidthID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadScreenHeight:
Gui, MyWindow:Add, Text, vReadScreenHeightID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadMonstersSpawned:
Gui, MyWindow:Add, Text, vReadMonstersSpawnedID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadChampLvlByID:
Gui, MyWindow:Add, Text, vReadChampLvlByIDID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadCoreXP:
Gui, MyWindow:Add, Text, vReadCoreXPID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadGems:
Gui, MyWindow:Add, Text, vReadGemsID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadGemsSpent:
Gui, MyWindow:Add, Text, vReadGemsSpentID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadRedGems:
Gui, MyWindow:Add, Text, vReadRedGemsID x+2 w200,
Gui, MyWindow:Add, Text, x15 y+5, ReadChampBenchedByID:
Gui, MyWindow:Add, Text, vReadChampBenchedByIDID x+2 w200,
Gui, MyWindow:Font, w700
Gui, MyWindow:Add, Text, x15 y+15, Server Call Variables:
Gui, MyWindow:Font, w400
Gui, MyWindow:Add, Text, x15 y+5, advtoload:
Gui, MyWindow:Add, Text, vadvtoloadID x+2 w300, % advtoload
Gui, MyWindow:Add, Text, x15 y+5, current_adventure_id:
Gui, MyWindow:Add, Text, vCurrentAdventureID x+2 w300,
Gui, MyWindow:Add, Text, x15 y+5, InstanceID:
Gui, MyWindow:Add, Text, vInstanceIDID x+2 w300, % InstanceID
Gui, MyWindow:Add, Text, x15 y+5, ActiveInstance:
Gui, MyWindow:Add, Text, vActiveInstanceID x+2 w300, % ActiveInstance
Gui, MyWindow:Show
;GUI to input a new install path.
Gui, InstallGUI:New
Gui, InstallGUI:Add, Edit, vNewInstallPath x15 y+10 w300 r5, % gInstallPath
Gui, InstallGUI:Add, Button, x15 y+25 gInstallOK_Clicked, Save and `Close
Gui, InstallGUI:Add, Button, x+100 gInstallCancel_Clicked, `Cancel
InstallCancel_Clicked:
{
GuiControl, InstallGUI:, NewInstallPath, %gInstallPath%
Gui, InstallGUI:Hide
Return
}
InstallOK_Clicked:
{
Gui, Submit, NoHide
gInstallPath := NewInstallPath
GuiControl, MyWindow:, gInstallPathID, %gInstallPath%
IniWrite, %gInstallPath%, Usersettings.ini, Section1, GameInstallPath
Gui, InstallGUI:Hide
Return
}
ChangeInstallLocation_Clicked:
{
Gui, InstallGUI:Show
Return
}
Save_Clicked:
{
Gui, Submit, NoHide
Loop, 12
{
gSeatToggle[A_Index] := CheckboxSeat%A_Index%
var := CheckboxSeat%A_Index%
IniWrite, %var%, UserSettings.ini, Section1, Seat%A_Index%Toggle
}
gFKeys :=
Loop, 12
{
if (gSeatToggle[A_Index])
{
gFKeys = %gFKeys%{F%A_Index%}
IniWrite, 1, UserSettings.ini, Section1, Seat%A_Index%Toggle
}
Else
IniWrite, 0, UserSettings.ini, Section1, Seat%A_Index%Toggle
}
GuiControl, MyWindow:, gFkeysID, % gFKeys
gAreaLow := NewgAreaLow
GuiControl, MyWindow:, gAreaLowID, % gAreaLow
IniWrite, %gAreaLow%, UserSettings.ini, Section1, AreaLow
gMinStackZone := NewgMinStackZone
GuiControl, MyWindow:, gMinStackZoneID, % gMinStackZone
IniWrite, %gMinStackZone%, Usersettings.ini, Section1, MinStackZone
gSBTargetStacks := NewSBTargetStacks
GuiControl, MyWindow:, gSBTargetStacksID, % gSBTargetStacks
IniWrite, %gSBTargetStacks%, UserSettings.ini, Section1, SBTargetStacks
gSBTimeMax := NewgSBTimeMax
GuiControl, MyWindow:, gSBTimeMaxID, %gSBTimeMax%
IniWrite, %gSBTimeMax%, Usersettings.ini, Section1, SBTimeMax
gDashSleepTime := NewDashSleepTime
GuiControl, MyWindow:, DashSleepTimeID, % gDashSleepTime
IniWrite, %gDashSleepTime%, UserSettings.ini, Section1, DashSleepTime
gContinuedLeveling := NewContinuedLeveling
GuiControl, MyWindow:, gContinuedLevelingID, % gContinuedLeveling
IniWrite, %gContinuedLeveling%, UserSettings.ini, Section1, ContinuedLeveling
gHewUlt := NewHewUlt
GuiControl, MyWindow:, gHewUltID, % gHewUlt
IniWrite, %gHewUlt%, UserSettings.ini, Section1, HewUlt
GuiControl, MyWindow:, gUltsID, % gUlts
IniWrite, %gUlts%, UserSettings.ini, Section1, Ults
GuiControl, MyWindow:, gAvoidBossesID, % gAvoidBosses
IniWrite, %gAvoidBosses%, UserSettings.ini, Section1, AvoidBosses
GuiControl, MyWindow:, gClickLevelingID, % gClickLeveling
IniWrite, %gClickLeveling%, UserSettings.ini, Section1, ClickLeveling
GuiControl, MyWindow:, gCtrlClickLevelingID, % gCtrlClickLeveling
IniWrite, %gCtrlClickLeveling%, UserSettings.ini, Section1, CtrlClickLeveling
GuiControl, MyWindow:, gStackFailRecoveryID, % gStackFailRecovery
IniWrite, %gStackFailRecovery%, UserSettings.ini, Section1, StackFailRecovery
GuiControl, MyWindow:, gStackFailConvRecoveryID, % gStackFailConvRecovery
IniWrite, %gStackFailConvRecovery%, UserSettings.ini, Section1, StackFailConvRecovery
gSwapSleep := NewSwapSleep
GuiControl, MyWindow:, gSwapSleepID, % gSwapSleep
IniWrite, %gSwapSleep%, UserSettings.ini, Section1, SwapSleep
gRestartStackTime := NewRestartStackTime
GuiControl, MyWindow:, gRestartStackTimeID, % gRestartStackTime
IniWrite, %gRestartStackTime%, UserSettings.ini, Section1, RestartStackTime
GuiControl, MyWindow:, gDoChestsID, % gDoChests
IniWrite, %gDoChests%, UserSettings.ini, Section1, DoChests
gSCMinGemCount := NewSCMinGemCount
GuiControl, MyWindow:, gSCMinGemCount, % gSCMinGemCount
IniWrite, %gSCMinGemCount%, UserSettings.ini, Section1, SCMinGemCount
gSCBuySilvers := NewSCBuySilvers
if (gSCBuySilvers > 100)
gSCBuySilvers := 100
GuiControl, MyWindow:, gSCBuySilversID, % gSCBuySilvers
IniWrite, %gSCBuySilvers%, UserSettings.ini, Section1, SCBuySilvers
gSCSilverCount := NewSCSilverCount
if (gSCSilverCount > 99)
gSCSilverCount := 99
GuiControl, MyWindow:, gSCSilverCountID, % gSCSilverCount
IniWrite, %gSCSilverCount%, UserSettings.ini, Section1, SCSilverCount
gSCBuyGolds := NewSCBuyGolds
if (gSCBuyGolds > 100)
gSCBuyGolds := 100
GuiControl, MyWindow:, gSCBuyGoldsID, % gSCBuyGolds
IniWrite, %gSCBuyGolds%, UserSettings.ini, Section1, SCBuyGolds
gSCGoldCount := NewSCGoldCount
if (gSCGoldCount > 99)
gSCGoldCount := 99
GuiControl, MyWindow:, gSCGoldCountID, % gSCGoldCount
IniWrite, %gSCGoldCount%, UserSettings.ini, Section1, SCGoldCount
return
}
Reload_Clicked:
{
Reload
return
}
Run_Clicked:
{
gStartTime := A_TickCount
gRunStartTime := A_TickCount
GemFarm()
return
}
MyWindowGuiClose()
{
MsgBox 4,, Are you sure you want to `exit?
IfMsgBox Yes
ExitApp
IfMsgBox No
return True
}
$`::
Pause
gPrevLevelTime := A_TickCount
return
;a function that checks if IC is closed and restarts it. Then opens the process and reads the module base address, two necessary steps to read memory.
SafetyCheck()
{
While (Not WinExist("ahk_exe IdleDragons.exe"))
{
Run, %gInstallPath%
;Run, "C:\Program Files (x86)\Steam\steamapps\common\IdleChampions\IdleDragons.exe"
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Opening IC
While (Not WinExist("ahk_exe IdleDragons.exe") AND ElapsedTime < 60000)
{
Sleep 1000
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
If (Not WinExist("ahk_exe IdleDragons.exe"))
Return
;the script doesn't update GUI with elapsed time while IC is loading, opening the address, or readying base address, to minimize use of CPU.
GuiControl, MyWindow:, gloopID, Opening `Process
Sleep gOpenProcess
OpenProcess()
GuiControl, MyWindow:, gloopID, Loading Module Base
Sleep gGetAddress
LoadingZoneREV()
if (gUlts)
DoUlts()
;reset timer for checking if IC is stuck on a zone.
gPrevLevelTime := A_TickCount
}
}
;A function that closes IC. If IC takes longer than 60 seconds to save and close then the script will force it closed.
CloseIC()
{
PostMessage, 0x112, 0xF060,,, ahk_exe IdleDragons.exe
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Saving and Closing IC
While (WinExist("ahk_exe IdleDragons.exe") AND ElapsedTime < 60000)
{
Sleep 100
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
While (WinExist("ahk_exe IdleDragons.exe"))
{
GuiControl, MyWindow:, gloopID, Forcing IC Close
PostMessage, 0x112, 0xF060,,, ahk_exe IdleDragons.exe
sleep 1000
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
}
;A function that checks if farmed SB stacks from previous run failed to convert to haste. If so, the script will manually end the adventure to attempt to covnert the stacks, close IC, use a servercall to restart the adventure, and restart IC.
CheckForFailedConv()
{
stacks := GetNumStacksFarmed()
If (gStackCountH < gSBTargetStacks AND stacks > gSBTargetStacks)
{
EndAdventure()
;If this sleep is too low it can cancel the reset before it completes. In this case that could be good as it will convert SB to Haste and not end the adventure.
;Sleep, 2000
CloseIC()
if (GetUserDetails() = -1)
{
LoadAdventure()
}
SafetyCheck()
gStackFail := 2
return
}
return
}
FinishZone()
{
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Finishing Zone
while (ReadQuestRemaining(1) AND ElapsedTime < 15000)
{
StuffToSpam(0, gLevel_Number)
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
return
}
LevelChampByID(ChampID := 1, Lvl := 0, i := 5000, j := "q", seat := 1)
{
;seat := ReadChampSeatByID(,, ChampID)
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Leveling Champ %ChampID% to %Lvl%
var := "{F" . seat . "}"
var := var . "{" . j . "}"
while (ReadChampLvlByID(1,,ChampID) < Lvl AND ElapsedTime < i)
{
DirectedInput(var)
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
return
}
DoDashWait()
{
LevelChampByID(47, 120, 5000, "q", 6)
;DirectedInput("{g}")
ToggleAutoProgress( 0 )
StartTime := A_TickCount
ElapsedTime := 0
LevelChampByID(58, 80, 5000, "q", 5)
ToggleAutoProgress( 0 )
gTime := ReadTimeScaleMultiplier(1)
if (gTime < 1)
gTime := 1
DashSpeed := gTime * 1.4
modDashSleep := gDashSleepTime / gTime
if (modDashSleep < 1)
modDashSleep := gDashSleepTime
GuiControl, MyWindow:, NewDashSleepID, % modDashSleep
if (gStackFailConvRecovery)
{
CheckForFailedConv()
}
GuiControl, MyWindow:, gloopID, Dash Wait
While (ReadTimeScaleMultiplier(1) < DashSpeed AND ElapsedTime < modDashSleep AND ReadCurrentZone(1) = 1)
{
StuffToSpam(0, 1, 0)
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
if (ReadQuestRemaining(1))
FinishZone()
if (gUlts)
{
DoUlts()
}
;DirectedInput("{g}")
ToggleAutoProgress( 1 )
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Finishing Zone 1
while (ReadCurrentZone(1) == 1 AND ElapsedTime < 5000)
{
SetFormation(1)
DirectedInput("{Right}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
return
}
DoUlts()
{
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Spamming Ults for 2s
while (ElapsedTime < 2000)
{
DirectedInput("23456789")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
}
DirectedInput(s)
{
SafetyCheck()
ControlFocus,, ahk_exe IdleDragons.exe
ControlSend,, {Blind}%s%, ahk_exe IdleDragons.exe
Sleep, %ScriptSpeed%
}
SetFormation(gLevel_Number)
{
if (gAvoidBosses AND !Mod(gLevel_Number, 5))
{
DirectedInput("{e}")
}
else if (!ReadQuestRemaining(1) AND ReadTransitioning(1) AND gLevel_Number < gAreaLow)
{
DirectedInput("{e}")
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, ReadTransitioning
while (ElapsedTime < 5000 AND !ReadQuestRemaining(1))
{
DirectedInput("{e}{Right}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
StartTime := A_TickCount
ElapsedTime := 0
gTime := ReadTimeScaleMultiplier(1)
swapSleepMod := gSwapSleep / gTime
GuiControl, MyWindow:, gloopID, Still ReadTransitioning
while (ElapsedTime < swapSleepMod AND ReadTransitioning(1))
{
DirectedInput("{e}{Right}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
DirectedInput("{q}")
}
else
DirectedInput("{q}")
}
LoadingZoneREV()
{
;look for Briv benched when spamming 'e' formation.
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Loading Zone
while (ReadChampBenchedByID(1,, 58) != 1 AND ElapsedTime < 60000)
{
DirectedInput("{e}{F5}{e}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
;check if stuck function would fail here on some cases where game gets stuck in offline progress calc, common after invalid instance. memory would read as if progress was still happening.
if (ElapsedTime > 60000)
{
CloseIC()
Sleep, 1000
SafetyCheck()
}
;look for Briv no benched when spamming 'w' formation.
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Confirming Zone Load
while (ReadChampBenchedByID(1,, 58) != 0 AND ElapsedTime < 30000)
{
DirectedInput("{w}{F5}{w}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
;check if stuck function would fail here on some cases where game gets stuck in offline progress calc, common after invalid instance. memory would read as if progress was still happening.
if (ElapsedTime > 30000)
{
CloseIC()
Sleep, 1000
SafetyCheck()
}
}
LoadingZoneOne()
{
;look for Briv not benched when spamming 'q' formation.
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Loading Zone
while (ReadChampBenchedByID(1,, 58) != 0 AND ElapsedTime < 60000)
{
DirectedInput("{q}{F5}{q}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
if (ElapsedTime > 60000)
{
CheckifStuck(gprevLevel)
}
;look for Briv benched when spamming 'e' formation.
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Confirming Zone Load
while (ReadChampBenchedByID(1,, 58) != 1 AND ElapsedTime < 60000)
{
DirectedInput("{e}{F5}{e}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
if (ElapsedTime > 60000)
{
CheckifStuck(gprevLevel)
}
}
CheckSetUpREV()
{
;Check if Briv is in 'Q' formation.
StartTime := A_TickCount
ElapsedTime := 0
slot := 0
GuiControl, MyWindow:, gloopID, Looking for Briv
Loop, 5
{
DirectedInput("{q}{F5}{q}")
sleep, 100
if (ReadChampBenchedByID(1,, 58) = 0)
break
}
while (ReadChampBenchedByID(1,, 58) != 0 AND ElapsedTime < 10000)
{
DirectedInput("{q}{F5}{q}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
if (ReadChampBenchedByID(1,, 58) = 1)
{
MsgBox, Couldn't find Briv in "Q" formation. Check saved formations. Ending Gem Farm.
Return, 1
}
;Check if Briv is not in 'E' formation.
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Looking for no Briv
while (ReadChampBenchedByID(1,, 58) != 1 AND ElapsedTime < 10000)
{
DirectedInput("{e}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
if (ReadChampBenchedByID(1,, 58) = 0)
{
MsgBox, Briv is in "E" formation. Check Settings. Ending Gem Farm.
return, 1
}
if (advtoload < 1)
{
MsgBox, Please load into a valid adventure and restart. Ending Gem Farm.
return, 1
}
return, 0
}
GetNumStacksFarmed()
{
gStackCountSB := ReadSBStacks(1)
GuiControl, MyWindow:, gStackCountSBID, %gStackCountSB%
gStackCountH := ReadHasteStacks(1)
GuiControl, MyWindow:, gStackCountHID, %gStackCountH%
if (gRestartStackTime)
{
return gStackCountH + gStackCountSB
}
else
{
; If restart stacking is disabled, we'll stack to basically the exact
; threshold. That means that doing a single jump would cause you to
; lose stacks to fall below the threshold, which would mean StackNormal
; would happen after every jump.
; Thus, we use a static 47 instead of using the actual haste stacks
; with the assumption that we'll be at minimum stacks after a reset.
return gStackCountSB + 47
}
}
StackRestart()
{
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Transitioning to Stack Restart
while (ReadTransitioning(1))
{
DirectedInput("{w}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Confirming "w" Loaded
;added due to issues with Loading Zone function, see notes therein
while (ReadChampBenchedByID(1,, 47) != 1 AND ElapsedTime < 15000)
{
DirectedInput("{w}")
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
Sleep 1000
CloseIC()
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Stack `Sleep
if (gDoChests)
{
DoChests()
ElapsedTime := UpdateElapsedTime(StartTime)
GuiControl, MyWindow:, gloopID, Finish Stack `Sleep: %ElapsedTime%
}
while (ElapsedTime < gRestartStackTime)
{
Sleep 100
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
}
SafetyCheck()
;Game may save "q" formation before restarting, creating an endless restart loop. LoadinZone() should bring "w" back before triggering a second restart, but monsters could spawn before it does.
;this doesn't appear to help the issue above.
DirectedInput("{w}")
}
StackNormal()
{
StartTime := A_TickCount
ElapsedTime := 0
GuiControl, MyWindow:, gloopID, Stack Normal
stacks := GetNumStacksFarmed()
while (stacks < gSBTargetStacks AND ElapsedTime < gSBTimeMax)
{
directedinput("{w}")
if (ReadCurrentZone(1) <= gAreaLow)
{
DirectedInput("{Right}")
}
Sleep 1000
stacks := GetNumStacksFarmed()
ElapsedTime := UpdateElapsedTime(StartTime)
UpdateStatTimers()
if (ReadResetting(1) OR ReadCurrentZone(1) = 1)
Return
}