-
Notifications
You must be signed in to change notification settings - Fork 34
/
IdleCombos.ahk
2576 lines (2463 loc) · 83.2 KB
/
IdleCombos.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
#include %A_ScriptDir%
#include JSON.ahk
#include idledict.ahk
;Added in 1.8
;-Pity Timer for Golds on Inventory Tab
;-Event Pity Timers in the Chests menu
;-More info on number of tokens/FPs available
;-Kleho image now works for Events & TGs
;-Fix for "Chests Opened: 0" in log output
;-Dictionary file updated to 1.8
;-(Also resized the window finally) :P
;Special thanks to all the idle dragons who inspired and assisted me!
global VersionNumber := "1.8"
global CurrentDictionary := "1.8"
;Local File globals
global OutputLogFile := "idlecombolog.txt"
global SettingsFile := "idlecombosettings.json"
global UserDetailsFile := "userdetails.json"
global ChestOpenLogFile := "chestopenlog.json"
global BlacksmithLogFile := "blacksmithlog.json"
global RedeemCodeLogFile := "redeemcodelog.json"
global JournalFile := "journal.json"
global CurrentSettings := []
global GameInstallDir := "C:\Program Files (x86)\Steam\steamapps\common\IdleChampions\"
global WRLFile := GameInstallDir "IdleDragons_Data\StreamingAssets\downloaded_files\webRequestLog.txt"
global DictionaryFile := "https://raw.githubusercontent.com/QuickMythril/idlecombos/master/idledict.ahk"
global LocalDictionary := "idledict.ahk"
global ICSettingsFile := A_AppData
StringTrimRight, ICSettingsFile, ICSettingsFile, 7
ICSettingsFile := ICSettingsFile "LocalLow\Codename Entertainment\Idle Champions\localSettings.json"
global GameClient := GameInstallDir "IdleDragons.exe"
;Settings globals
global GetDetailsonStart := 0
global LaunchGameonStart := 0
global FirstRun := 1
global AlwaysSaveChests := 0
global AlwaysSaveContracts := 0
global AlwaysSaveCodes := 0
global SettingsCheckValue := 9 ;used to check for outdated settings file
global NewSettings := JSON.stringify({"firstrun":0,"user_id":0,"hash":0,"instance_id":0,"getdetailsonstart":0,"launchgameonstart":0,"alwayssavechests":1,"alwayssavecontracts":1,"alwayssavecodes":1})
;Server globals
global DummyData := "&language_id=1×tamp=0&request_id=0&network_id=11&mobile_client_version=999"
global CodestoEnter := ""
;User info globals
global UserID := 0
global UserHash := 0
global InstanceID := 0
global UserDetails := []
global ActiveInstance := 0
global CurrentAdventure := ""
global CurrentArea := ""
global CurrentPatron := ""
global BackgroundAdventure := ""
global BackgroundArea := ""
global BackgroundPatron := ""
global AchievementInfo := "This page intentionally left blank.`n`n`n`n`n`n`n"
global BlessingInfo := "`n`n`n`n`n`n"
global ChampDetails := ""
global TotalChamps := 0
;Inventory globals
global CurrentGems := ""
global AvailableChests := ""
global SpentGems := ""
global CurrentGolds := ""
global GoldPity := ""
global CurrentSilvers := ""
global CurrentTGPs := ""
global AvailableTGs := ""
global NextTGPDrop := ""
global CurrentTokens := ""
global CurrentSmBounties := ""
global CurrentMdBounties := ""
global CurrentLgBounties := ""
global AvailableTokens := ""
global AvailableFPs := ""
global CurrentTinyBS := ""
global CurrentSmBS := ""
global CurrentMdBS := ""
global CurrentLgBS := ""
global AvailableBSLvs := ""
;Loot globals
global EpicGearCount := 0
global BrivSlot4 := 0
global BrivZone := 0
;Modron globals
global FGCore := "`n`n"
global BGCore := "`n`n"
;Patron globals
global MirtVariants := ""
global MirtCompleted := ""
global MirtVariantTotal := ""
global MirtFPCurrency := ""
global MirtChallenges := ""
global MirtRequires := ""
global MirtCosts := ""
global VajraVariants := ""
global VajraCompleted := ""
global VajraVariantTotal := ""
global VajraFPCurrency := ""
global VajraChallenges := ""
global VajraRequires := ""
global VajraCosts := ""
global StrahdVariants := ""
global StrahdCompleted := ""
global StrahdVariantTotal := ""
global StrahdFPCurrency := ""
global StrahdChallenges := ""
global StrahdRequires := ""
global StrahdCosts := ""
;GUI globals
global oMyGUI := ""
global OutputText := "Test"
global OutputStatus := "Welcome to IdleCombos v" VersionNumber
global CurrentTime := ""
global CrashProtectStatus := "Crash Protect`nDisabled"
global CrashCount := 0
global LastUpdated := "No data loaded."
global TrayIcon := systemroot "\system32\imageres.dll"
global LastBSChamp := ""
;BEGIN: default run commands
if FileExist(TrayIcon) {
if (SubStr(A_OSVersion, 1, 2) == 10) {
Menu, Tray, Icon, %TrayIcon%, 300
}
else if (A_OSVersion == "WIN_8") {
Menu, Tray, Icon, %TrayIcon%, 284
}
else if (A_OSVersion == "WIN_7") {
Menu, Tray, Icon, %TrayIcon%, 78
}
else if (A_OSVersion == "WIN_VISTA") {
Menu, Tray, Icon, %TrayIcon%, 77
} ; WIN_8.1, WIN_2003, WIN_XP, WIN_2000, WIN_NT4, WIN_95, WIN_98, WIN_ME
}
UpdateLogTime()
FileAppend, (%CurrentTime%) IdleCombos v%VersionNumber% started.`n, %OutputLogFile%
FileRead, OutputText, %OutputLogFile%
if (!oMyGUI) {
oMyGUI := new MyGui()
}
;First run checks and setup
if !FileExist(SettingsFile) {
FileAppend, %NewSettings%, %SettingsFile%
UpdateLogTime()
FileAppend, (%CurrentTime%) Settings file "idlecombosettings.json" created.`n, %OutputLogFile%
FileRead, OutputText, %OutputLogFile%
oMyGUI.Update()
}
FileRead, rawsettings, %SettingsFile%
CurrentSettings := JSON.parse(rawsettings)
if !(CurrentSettings.Count() == SettingsCheckValue) {
FileDelete, %SettingsFile%
FileAppend, %NewSettings%, %SettingsFile%
UpdateLogTime()
FileAppend, (%CurrentTime%) Settings file "idlecombosettings.json" created.`n, %OutputLogFile%
FileRead, OutputText, %OutputLogFile%
FileRead, rawsettings, %SettingsFile%
CurrentSettings := JSON.parse(rawsettings)
oMyGUI.Update()
MsgBox, Your settings file has been deleted due to an update to IdleCombos. Please verify that your settings are set as preferred.
}
if FileExist(A_ScriptDir "\webRequestLog.txt") {
MsgBox, 4, , % "WRL File detected. Use file?"
IfMsgBox, Yes
{
WRLFile := A_ScriptDir "\webRequestLog.txt"
FirstRun()
}
}
if !(CurrentSettings.firstrun) {
FirstRun()
}
if (CurrentSettings.user_id && CurrentSettings.hash) {
UserID := CurrentSettings.user_id
UserHash := CurrentSettings.hash
InstanceID := CurrentSettings.instance_id
SB_SetText("User ID & Hash ready.")
}
else {
SB_SetText("User ID & Hash not found!")
}
;Loading current settings
GetDetailsonStart := CurrentSettings.getdetailsonstart
LaunchGameonStart := CurrentSettings.launchgameonstart
AlwaysSaveChests := CurrentSettings.alwayssavechests
AlwaysSaveContracts := CurrentSettings.alwayssavecontracts
AlwaysSaveCodes := CurrentSettings.alwayssavecodes
if (GetDetailsonStart == "1") {
GetUserDetails()
}
if (LaunchGameonStart == "1") {
LaunchGame()
}
oMyGUI.Update()
SendMessage, 0x115, 7, 0, Edit1, A
return
;END: default run commands
;BEGIN: GUI Defs
class MyGui {
Width := "550"
Height := "250"
__New()
{
Gui, MyWindow:New
Gui, MyWindow:+Resize -MaximizeBox
Menu, ICSettingsSubmenu, Add, &View Settings, ViewICSettings
Menu, ICSettingsSubmenu, Add, &Framerate, SetFramerate
Menu, ICSettingsSubmenu, Add, &Particles, SetParticles
Menu, ICSettingsSubmenu, Add, &UI Scale, SetUIScale
Menu, FileSubmenu, Add, &Idle Champions Settings, :ICSettingsSubmenu
Menu, FileSubmenu, Add, &Launch Game Client, LaunchGame
Menu, FileSubmenu, Add, &Update UserDetails, GetUserDetails
Menu, FileSubmenu, Add
Menu, FileSubmenu, Add, &Reload IdleCombos, Reload_Clicked
Menu, FileSubmenu, Add, E&xit IdleCombos, Exit_Clicked
Menu, IdleMenu, Add, &File, :FileSubmenu
Menu, ChestsSubmenu, Add, Buy Gold, Buy_Gold
Menu, ChestsSubmenu, Add, Buy Silver, Buy_Silver
Menu, ChestsSubmenu, Add, Open Gold, Open_Gold
Menu, ChestsSubmenu, Add, Open Silver, Open_Silver
Menu, ChestsSubmenu, Add, Pity Timers, ShowPityTimers
Menu, ToolsSubmenu, Add, &Chests, :ChestsSubmenu
Menu, BlacksmithSubmenu, Add, Use Tiny Contracts, Tiny_Blacksmith
Menu, BlacksmithSubmenu, Add, Use Small Contracts, Sm_Blacksmith
Menu, BlacksmithSubmenu, Add, Use Medium Contracts, Med_Blacksmith
Menu, BlacksmithSubmenu, Add, Use Large Contracts, Lg_Blacksmith
Menu, BlacksmithSubmenu, Add, Item Level Report, GearReport
Menu, BlacksmithSubmenu, Add, Active Patron Feats, PatronFeats
Menu, ToolsSubmenu, Add, &Blacksmith, :BlacksmithSubmenu
Menu, ToolsSubmenu, Add, &Redeem Codes, Open_Codes
Menu, AdvSubmenu, Add, &Load New Adv, LoadAdventure
Menu, AdvSubmenu, Add, &End Current Adv, EndAdventure
;Menu, AdvSubmenu, Add, Load New BG Adv, LoadBGAdventure
Menu, AdvSubmenu, Add, End Background Adv, EndBGAdventure
Menu, AdvSubmenu, Add, &Kleho Image, KlehoImage
Menu, AdvSubmenu, Add, &Incomplete Variants, IncompleteVariants
Menu, AdvSubmenu, Add, Adventure List, AdventureList
Menu, ToolsSubmenu, Add, &Adventure Manager, :AdvSubmenu
Menu, ToolsSubmenu, Add, &Briv Stack Calculator, Briv_Calc
Menu, IdleMenu, Add, &Tools, :ToolsSubmenu
Menu, HelpSubmenu, Add, &Run Setup, FirstRun
Menu, HelpSubmenu, Add, Clear &Log, Clear_Log
Menu, HelpSubmenu, Add, Download &Journal, Get_Journal
Menu, HelpSubmenu, Add, CNE &Support Ticket, Open_Ticket
Menu, HelpSubmenu, Add
Menu, HelpSubmenu, Add, &List Champ IDs, List_ChampIDs
Menu, HelpSubmenu, Add, &About IdleCombos, About_Clicked
Menu, HelpSubmenu, Add, &Update Dictionary, Update_Dictionary
Menu, HelpSubmenu, Add, &Discord Support Server, Discord_Clicked
Menu, IdleMenu, Add, &Help, :HelpSubmenu
Gui, Menu, IdleMenu
col1_x := 5
col2_x := 420
col3_x := 480
row_y := 5
Gui, Add, StatusBar,, %OutputStatus%
Gui, MyWindow:Add, Button, x%col2_x% y%row_y% w60 gReload_Clicked, Reload
Gui, MyWindow:Add, Button, x%col3_x% y%row_y% w60 gExit_Clicked, Exit
Gui, MyWindow:Add, Tab3, x%col1_x% y%row_y% w400, Summary|Adventures|Inventory||Patrons|Champions|Settings|Log|
Gui, Tab
row_y := row_y + 25
;Gui, MyWindow:Add, Button, x%col3_x% y%row_y% w60 gUpdate_Clicked, Update
row_y := row_y + 25
Gui, MyWindow:Add, Text, x410 y53 vCrashProtectStatus, % CrashProtectStatus
Gui, MyWindow:Add, Button, x%col3_x% y%row_y% w60 gCrash_Toggle, Toggle
Gui, MyWindow:Add, Text, x410 y100, Data Timestamp:
Gui, MyWindow:Add, Text, x410 y120 vLastUpdated w220, % LastUpdated
Gui, MyWindow:Add, Button, x410 y140 w60 gUpdate_Clicked, Update
Gui, Tab, Summary
Gui, MyWindow:Add, Text, vAchievementInfo x15 y33 w300, % AchievementInfo
Gui, MyWindow:Add, Text, vBlessingInfo x200 y33 w300, % BlessingInfo
Gui, Tab, Adventures
Gui, MyWindow:Add, Text, x15 y33 w120, Current Adventure:
Gui, MyWindow:Add, Text, vCurrentAdventure x+2 w50, % CurrentAdventure
Gui, MyWindow:Add, Text, x15 y+p w120, Current Patron:
Gui, MyWindow:Add, Text, vCurrentPatron x+2 w50, % CurrentPatron
Gui, MyWindow:Add, Text, x15 y+p w120, Current Area:
Gui, MyWindow:Add, Text, vCurrentArea x+2 w50, % CurrentArea
Gui, MyWindow:Add, Text, x15 y76 w120, Background Adventure:
Gui, MyWindow:Add, Text, vBackgroundAdventure x+2 w50, % BackgroundAdventure
Gui, MyWindow:Add, Text, x15 y+p w120, Background Patron:
Gui, MyWindow:Add, Text, vBackgroundPatron x+2 w50, % BackgroundPatron
Gui, MyWindow:Add, Text, x15 y+p w120, Background Area:
Gui, MyWindow:Add, Text, vBackgroundArea x+2 w50, % BackgroundArea
Gui, MyWindow:Add, Text, vFGCore x200 y33 w150, % FGCore
Gui, MyWindow:Add, Text, vBGCore x200 y76 w150, % BGCore
Gui, Tab, Inventory
Gui, MyWindow:Add, Text, x15 y33 w70, Current Gems:
Gui, MyWindow:Add, Text, vCurrentGems x+2 w75 right, % CurrentGems
Gui, MyWindow:Add, Text, vAvailableChests x+10 w190, % AvailableChests
Gui, MyWindow:Add, Text, x15 y+p w70, (Spent Gems):
Gui, MyWindow:Add, Text, vSpentGems x+2 w75 right, % SpentGems
Gui, MyWindow:Add, Text, x15 y+5+p w110, Gold Chests:
Gui, MyWindow:Add, Text, vCurrentGolds x+2 w35 right, % CurrentGolds
Gui, MyWindow:Add, Text, vGoldPity x+10 w190, % GoldPity
Gui, MyWindow:Add, Text, x15 y+p w110, Silver Chests:
Gui, MyWindow:Add, Text, vCurrentSilvers x+2 w35 right, % CurrentSilvers
Gui, MyWindow:Add, Text, x+105 y+1 w185, Next TGP:
Gui, MyWindow:Add, Text, x15 y+0 w110, Time Gate Pieces:
Gui, MyWindow:Add, Text, vCurrentTGPs x+2 w35 right, % CurrentTGPs
Gui, MyWindow:Add, Text, vAvailableTGs x+10 w85, % AvailableTGs
Gui, MyWindow:Add, Text, vNextTGPDrop x+10 w220, % NextTGPDrop
Gui, MyWindow:Add, Text, x15 y+5+p w110, Small Bounties:
Gui, MyWindow:Add, Text, vCurrentSmBounties x+2 w35 right, % CurrentSmBounties
Gui, MyWindow:Add, Text, vAvailableTokens x+10 w185, % AvailableTokens
Gui, MyWindow:Add, Text, x15 y+p w110, Medium Bounties:
Gui, MyWindow:Add, Text, vCurrentMdBounties x+2 w35 right, % CurrentMdBounties
Gui, MyWindow:Add, Text, vCurrentTokens x+10 w185, % CurrentTokens
Gui, MyWindow:Add, Text, x15 y+p w110, Large Bounties:
Gui, MyWindow:Add, Text, vCurrentLgBounties x+2 w35 right, % CurrentLgBounties
Gui, MyWindow:Add, Text, vAvailableFPs x+10 w185, % AvailableFPs
Gui, MyWindow:Add, Text, x15 y+5+p w110, Tiny Blacksmiths:
Gui, MyWindow:Add, Text, vCurrentTinyBS x+2 w35 right, % CurrentTinyBS
Gui, MyWindow:Add, Text, vAvailableBSLvs x+10 w175, % AvailableBSLvs
Gui, MyWindow:Add, Text, x15 y+p w110, Small Blacksmiths:
Gui, MyWindow:Add, Text, vCurrentSmBS x+2 w35 right, % CurrentSmBS
Gui, MyWindow:Add, Text, x15 y+p w110, Medium Blacksmiths:
Gui, MyWindow:Add, Text, vCurrentMdBS x+2 w35 right, % CurrentMdBS
Gui, MyWindow:Add, Text, x15 y+p w110, Large Blacksmiths:
Gui, MyWindow:Add, Text, vCurrentLgBS x+2 w35 right, % CurrentLgBS
Gui, Tab, Patrons
Gui, MyWindow:Add, Text, x15 y33 w75, Mirt Variants:
Gui, MyWindow:Add, Text, vMirtVariants x+p w75 right cRed, % MirtVariants
Gui, MyWindow:Add, Text, x15 y+p w95, Mirt FP Currency:
Gui, MyWindow:Add, Text, vMirtFPCurrency x+p w55 right cRed, % MirtFPCurrency
Gui, MyWindow:Add, Text, vMirtRequires x+2 w200 right, % MirtRequires
Gui, MyWindow:Add, Text, x15 y+p w95, Mirt Challenges:
Gui, MyWindow:Add, Text, vMirtChallenges x+p w55 right cRed, % MirtChallenges
Gui, MyWindow:Add, Text, vMirtCosts x+2 w200 right, % MirtCosts
Gui, MyWindow:Add, Text, x15 y+5+p w75, Vajra Variants:
Gui, MyWindow:Add, Text, vVajraVariants x+p w75 right cRed, % VajraVariants
Gui, MyWindow:Add, Text, x15 y+p w95, Vajra FP Currency:
Gui, MyWindow:Add, Text, vVajraFPCurrency x+p w55 right cRed, % VajraFPCurrency
Gui, MyWindow:Add, Text, vVajraRequires x+2 w200 right, % VajraRequires
Gui, MyWindow:Add, Text, x15 y+p w95, Vajra Challenges:
Gui, MyWindow:Add, Text, vVajraChallenges x+p w55 right cRed, % VajraChallenges
Gui, MyWindow:Add, Text, vVajraCosts x+2 w200 right, % VajraCosts
Gui, MyWindow:Add, Text, x15 y+5+p w75, Strahd Variants:
Gui, MyWindow:Add, Text, vStrahdVariants x+p w75 right cRed, % StrahdVariants
Gui, MyWindow:Add, Text, x15 y+p w95, Strahd FP Currency:
Gui, MyWindow:Add, Text, vStrahdFPCurrency x+p w55 right cRed, % StrahdFPCurrency
Gui, MyWindow:Add, Text, vStrahdRequires x+2 w200 right, % StrahdRequires
Gui, MyWindow:Add, Text, x15 y+p w95, Strahd Challenges:
Gui, MyWindow:Add, Text, vStrahdChallenges x+p w55 right cRed, % StrahdChallenges
Gui, MyWindow:Add, Text, vStrahdCosts x+2 w200 right, % StrahdCosts
Gui, Tab, Champions
Gui, MyWindow:Add, Text, vChampDetails x15 y33 w300 h150, % ChampDetails
Gui, Tab, Settings
Gui, MyWindow:Add, CheckBox, vGetDetailsonStart, Get User Details on start?
Gui, MyWindow:Add, CheckBox, vLaunchGameonStart, Launch game client on start?
Gui, MyWindow:Add, CheckBox, vAlwaysSaveChests, Always save Chest Open Results to file?
Gui, MyWindow:Add, CheckBox, vAlwaysSaveContracts, Always save Blacksmith Results to file?
Gui, MyWindow:Add, CheckBox, vAlwaysSaveCodes, Always save Code Redeem Results to file?
Gui, MyWindow:Add, Button, gSave_Settings, Save Settings
Gui, Tab, Log
Gui, MyWindow:Add, Edit, r12 vOutputText ReadOnly w360, %OutputText%
this.Show()
}
Show() {
;check if minimized if so leave it be
WinGet, OutputVar , MinMax, IdleCombos v%VersionNumber%
if (OutputVar = -1) {
return
}
nW := this.Width
nH := this.Height
Gui, MyWindow:Show, w%nW% h%nH%, IdleCombos v%VersionNumber%
}
Hide() {
Gui, MyWindow:Hide
}
Submit() {
Gui, MyWindow:Submit, NoHide
}
Update() {
GuiControl, MyWindow:, OutputText, % OutputText, w250 h210
SendMessage, 0x115, 7, 0, Edit1
GuiControl, MyWindow:, CrashProtectStatus, % CrashProtectStatus, w250 h210
GuiControl, MyWindow:, AchievementInfo, % AchievementInfo, w250 h210
GuiControl, MyWindow:, BlessingInfo, % BlessingInfo, w250 h210
GuiControl, MyWindow:, LastUpdated, % LastUpdated, w250 h210
;adventures
GuiControl, MyWindow:, CurrentAdventure, % CurrentAdventure, w250 h210
GuiControl, MyWindow:, CurrentArea, % CurrentArea, w250 h210
GuiControl, MyWindow:, CurrentPatron, % CurrentPatron, w250 h210
GuiControl, MyWindow:, BackgroundAdventure, % BackgroundAdventure, w250 h210
GuiControl, MyWindow:, BackgroundArea, % BackgroundArea, w250 h210
GuiControl, MyWindow:, BackgroundPatron, % BackgroundPatron, w250 h210
GuiControl, MyWindow:, FGCore, % FGCore, w250 h210
GuiControl, MyWindow:, BGCore, % BGCore, w250 h210
;inventory
GuiControl, MyWindow:, CurrentGems, % CurrentGems, w250 h210
GuiControl, MyWindow:, SpentGems, % SpentGems, w250 h210
GuiControl, MyWindow:, CurrentGolds, % CurrentGolds, w250 h210
GuiControl, MyWindow:, GoldPity, % GoldPity, w250 h210
GuiControl, MyWindow:, CurrentSilvers, % CurrentSilvers, w250 h210
GuiControl, MyWindow:, CurrentTGPs, % CurrentTGPs, w250 h210
GuiControl, MyWindow:, NextTGPDrop, % NextTGPDrop, w250 h210
GuiControl, MyWindow:, AvailableTGs, % AvailableTGs, w250 h210
GuiControl, MyWindow:, AvailableChests, % AvailableChests, w250 h210
GuiControl, MyWindow:, CurrentSmBounties, % CurrentSmBounties, w250 h210
GuiControl, MyWindow:, CurrentMdBounties, % CurrentMdBounties, w250 h210
GuiControl, MyWindow:, CurrentLgBounties, % CurrentLgBounties, w250 h210
GuiControl, MyWindow:, AvailableTokens, % AvailableTokens, w250 h210
GuiControl, MyWindow:, CurrentTokens, % CurrentTokens, w250 h210
GuiControl, MyWindow:, AvailableFPs, % AvailableFPs, w250 h210
GuiControl, MyWindow:, CurrentTinyBS, % CurrentTinyBS, w250 h210
GuiControl, MyWindow:, CurrentSmBS, % CurrentSmBS, w250 h210
GuiControl, MyWindow:, CurrentMdBS, % CurrentMdBS, w250 h210
GuiControl, MyWindow:, CurrentLgBS, % CurrentLgBS, w250 h210
GuiControl, MyWindow:, AvailableBSLvs, % AvailableBSLvs, w250 h210
;patrons
GuiControl, MyWindow:, MirtVariants, % MirtVariants, w250 h210
GuiControl, MyWindow:, MirtChallenges, % MirtChallenges, w250 h210
GuiControl, MyWindow:, MirtFPCurrency, % MirtFPCurrency, w250 h210
GuiControl, MyWindow:, MirtRequires, % MirtRequires, w250 h210
GuiControl, MyWindow:, MirtCosts, % MirtCosts, w250 h210
GuiControl, MyWindow:, VajraVariants, % VajraVariants, w250 h210
GuiControl, MyWindow:, VajraChallenges, % VajraChallenges, w250 h210
GuiControl, MyWindow:, VajraFPCurrency, % VajraFPCurrency, w250 h210
GuiControl, MyWindow:, VajraRequires, % VajraRequires, w250 h210
GuiControl, MyWindow:, VajraCosts, % VajraCosts, w250 h210
GuiControl, MyWindow:, StrahdVariants, % StrahdVariants, w250 h210
GuiControl, MyWindow:, StrahdChallenges, % StrahdChallenges, w250 h210
GuiControl, MyWindow:, StrahdFPCurrency, % StrahdFPCurrency, w250 h210
GuiControl, MyWindow:, StrahdRequires, % StrahdRequires, w250 h210
GuiControl, MyWindow:, StrahdCosts, % StrahdCosts, w250 h210
;champions
GuiControl, MyWindow:, ChampDetails, % ChampDetails, w250 h210
;settings
GuiControl, MyWindow:, GetDetailsonStart, % GetDetailsonStart, w250 h210
GuiControl, MyWindow:, LaunchGameonStart, % LaunchGameonStart, w250 h210
GuiControl, MyWindow:, AlwaysSaveChests, % AlwaysSaveChests, w250 h210
GuiControl, MyWindow:, AlwaysSaveContracts, % AlwaysSaveContracts, w250 h210
GuiControl, MyWindow:, AlwaysSaveCodes, % AlwaysSaveCodes, w250 h210
;this.Show() - removed
}
}
;Hotkeys
;$F9::Reload
;$F10::ExitApp
Update_Clicked:
{
GetUserDetails()
return
}
Reload_Clicked:
{
Reload
return
}
Exit_Clicked:
{
ExitApp
return
}
Crash_Toggle:
{
switch CrashProtectStatus {
case "Crash Protect`nDisabled": {
CrashProtectStatus := "Crash Protect`nEnabled"
oMyGUI.Update()
SB_SetText("Crash Protect has been enabled!")
CrashProtect()
}
case "Crash Protect`nEnabled": {
CrashProtectStatus := "Crash Protect`nDisabled"
CrashCount := 0
oMyGUI.Update()
SB_SetText("Crash Protect has been disabled.")
}
}
return
}
CrashProtect() {
loop {
if (CrashProtectStatus == "Crash Protect`nDisabled") {
return
}
While(Not WinExist("ahk_exe IdleDragons.exe")) {
Sleep 2500
Run, %GameClient%
++CrashCount
SB_SetText("Crash Protect has restarted your client.")
UpdateLogTime()
FileAppend, (%CurrentTime%) Restarts since enabling Crash Protect: %CrashCount%`n, %OutputLogFile%
FileRead, OutputText, %OutputLogFile%
oMyGUI.Update()
Sleep 10000
}
}
return
}
Save_Settings:
{
oMyGUI.Submit()
CurrentSettings.getdetailsonstart := GetDetailsonStart
CurrentSettings.launchgameonstart := LaunchGameonStart
CurrentSettings.alwayssavechests := AlwaysSaveChests
CurrentSettings.alwayssavecontracts := AlwaysSaveContracts
CurrentSettings.alwayssavecodes := AlwaysSaveCodes
newsettings := JSON.stringify(CurrentSettings)
FileDelete, %SettingsFile%
FileAppend, %newsettings%, %SettingsFile%
SB_SetText("Settings have been saved.")
return
}
About_Clicked:
{
MsgBox, , About IdleCombos v%VersionNumber%, IdleCombos v%VersionNumber% by QuickMythril`n`nSpecial thanks to all the idle dragons who inspired and assisted me!
return
}
Buy_Silver:
{
Buy_Chests(1)
return
}
Buy_Gold:
{
Buy_Chests(2)
return
}
Open_Silver:
{
if (Not WinExist("ahk_exe IdleDragons.exe")) {
Open_Chests(1)
return
}
else {
MsgBox, 4, , % "Note: It's recommended to close the game client before opening chests.`nWould you like to continue anyway?"
IfMsgBox, Yes
{
Open_Chests(1)
return
}
else IfMsgBox, No
{
return
}
}
}
Open_Gold:
{
if (Not WinExist("ahk_exe IdleDragons.exe")) {
Open_Chests(2)
return
}
else {
MsgBox, 4, , % "Note: It's recommended to close the game client before opening chests.`nWould you like to continue anyway?`n`n(Feats earned using this app do not count towards the related achievement.)"
IfMsgBox, Yes
{
Open_Chests(2)
return
}
else IfMsgBox, No
{
return
}
}
}
Open_Codes:
{
Gui, CodeWindow:New
Gui, CodeWindow:+Resize -MaximizeBox
Gui, CodeWindow:Show, w230 h220, Codes
Gui, CodeWindow:Add, Edit, r12 vCodestoEnter w190 x20 y20, IDLE-CHAM-PION-SNOW
Gui, CodeWindow:Add, Button, gRedeem_Codes, Submit
Gui, CodeWindow:Add, Text, w100 x+6 vCodesPending, Codes pending: 0
Gui, CodeWindow:Add, Button, x+4 gClose_Codes, Close
return
}
Redeem_Codes:
{
Gui, CodeWindow:Submit, NoHide
Gui, CodeWindow:Add, Text, x+45, Codes pending:
CodeList := StrSplit(CodestoEnter, "`n")
CodeCount := CodeList.Length()
CodesPending := "Codes pending: " CodeCount
GuiControl, , CodesPending, % CodesPending, w250 h210
usedcodes := ""
someonescodes := ""
expiredcodes := ""
earlycodes := ""
invalidcodes := ""
codegolds := 0
codesilvers := 0
codesupplys := 0
otherchests := ""
codeepics := ""
codetgps := 0
codepolish := 0
tempsavesetting := 0
tempnosavesetting := 0
for k, v in CodeList
{
v := StrReplace(v, "`r")
v := StrReplace(v, "`n")
v := Trim(v)
CurrentCode := v
sCode := RegExReplace(CurrentCode, "&", Replacement := "%26")
if !UserID {
MsgBox % "Need User ID & Hash."
FirstRun()
}
codeparams := DummyData "&user_id=" UserID "&hash=" UserHash "&instance_id=" InstanceID "&code=" sCode
rawresults := ServerCall("redeemcoupon", codeparams)
coderesults := JSON.parse(rawresults)
rawloot := JSON.stringify(coderesults.loot_details)
codeloot := JSON.parse(rawloot)
if (coderesults.failure_reason == "Outdated instance id") {
MsgBox, 4, , % "Outdated instance id. Update from server?"
IfMsgBox, Yes
{
GetUserDetails()
Gui, CodeWindow:Default
while (InstanceID == 0) {
sleep, 2000
}
codeparams := DummyData "&user_id=" UserID "&hash=" UserHash "&instance_id=" InstanceID "&code=" sCode
rawresults := ServerCall("redeemcoupon", codeparams)
coderesults := JSON.parse(rawresults)
}
else {
return
}
}
if (coderesults.failure_reason == "You have already redeemed this combination.") {
usedcodes := usedcodes sCode "`n"
}
else if (coderesults.failure_reason == "Someone has already redeemed this combination.") {
someonescodes := someonescodes sCode "`n"
}
else if (coderesults.failure_reason == "This offer has expired") {
expiredcodes := expiredcodes sCode "`n"
}
else if (coderesults.failure_reason == "You can not yet redeem this combination.") {
earlycodes := earlycodes sCode "`n"
}
else if (coderesults.failure_reason == "This is not a valid combination.") {
invalidcodes := invalidcodes sCode "`n"
}
else for kk, vv in codeloot
{
if (vv.chest_type_id == "2") {
codegolds += vv.count
}
else if (vv.chest_type_id == "37") {
codesupplys += vv.count
}
else if (vv.chest_type_id == "1") {
codesilvers += vv.count
}
else if (vv.chest_type_id) {
otherchests := otherchests ChestFromID(vv.chest_type_id) "`n"
}
else if (vv.add_time_gate_key_piece) {
codetgps += vv.count
}
else if (vv.add_inventory_buff_id) {
switch vv.add_inventory_buff_id
{
case 4: codeepics := codeepics "STR (" vv.count "), "
case 8: codeepics := codeepics "GF (" vv.count "), "
case 16: codeepics := codeepics "HP (" vv.count "), "
case 20: codeepics := codeepics "Bounty (" vv.count "), "
case 34: codeepics := codeepics "BS (" vv.count "), "
case 35: codeepics := codeepics "Spec (" vv.count "), "
case 40: codeepics := codeepics "FB (" vv.count "), "
case 77: codeepics := codeepics "Spd (" vv.count "), "
case 36: codepolish += vv.count
default: codeepics := codeepics vv.add_inventory_buff_id " (" vv.count "), "
}
}
}
CodeCount := % (CodeCount-1)
if (CurrentSettings.alwayssavecodes || tempsavesetting) {
FileAppend, %sCode%`n, %RedeemCodeLogFile%
FileAppend, %rawresults%`n, %RedeemCodeLogFile%
}
else if !(tempnosavesetting) {
MsgBox, 4, , "Save to File?"
IfMsgBox, Yes
{
tempsavesetting := 1
FileAppend, %sCode%`n, %RedeemCodeLogFile%
FileAppend, %rawresults%`n, %RedeemCodeLogFile%
}
else IfMsgBox, No
{
tempnosavesetting := 1
}
}
sleep, 2000
CodesPending := "Codes pending: " CodeCount
GuiControl, , CodesPending, % CodesPending, w250 h210
}
CodesPending := "Codes submitted!"
codemessage := ""
if !(usedcodes == "") {
codemessage := codemessage "You already used:`n" usedcodes "`n"
}
if !(someonescodes == "") {
codemessage := codemessage "Someone else used:`n" someonescodes "`n"
}
if !(expiredcodes == "") {
codemessage := codemessage "Expired:`n" expiredcodes "`n"
}
if !(invalidcodes == "") {
codemessage := codemessage "Invalid:`n" invalidcodes "`n"
}
if !(earlycodes == "") {
codemessage := codemessage "Cannot Redeem Yet:`n" earlycodes "`n"
}
if (codegolds > 0) {
codemessage := codemessage "Gold Chests:`n" codegolds "`n"
}
if (codesilvers > 0) {
codemessage := codemessage "Silver Chests:`n" codesilvers "`n"
}
if (codesupplys > 0) {
codemessage := codemessage "Supply Chests:`n" codesupplys "`n"
}
if !(otherchests == "") {
;StringTrimRight, otherchests, otherchests, 2
codemessage := codemessage "Other chests:`n" otherchests "`n"
}
if (codepolish > 0) {
codemessage := codemessage "Potions of Polish:`n" codepolish "`n"
}
if (codetgps > 0) {
codemessage := codemessage "Time Gate Pieces:`n" codetgps "`n"
}
if !(codeepics == "") {
StringTrimRight, codeepics, codeepics, 2
codemessage := codemessage "Epic consumables:`n" codeepics "`n"
}
if (codemessage == "") {
codemessage := "Unknown or No Results."
}
GuiControl, , CodesPending, % CodesPending, w250 h210
GetUserDetails()
oMyGUI.Update()
MsgBox, , Results, % codemessage
return
}
Briv_Calc:
{
InputBox, BrivSlot4, Briv Slot 4, Please enter the percentage listed`non your Briv Slot 4 item., , 250, 150, , , , , %BrivSlot4%
if (ErrorLevel=1) {
return
}
InputBox, BrivZone, Area to Reset, Please enter the area you will reset at`nafter building up Steelbones stacks., , 250, 150, , , , , %BrivZone%
if (ErrorLevel=1) {
return
}
MsgBox, 0, BrivCalc Results, % SimulateBriv(10000)
return
}
Close_Codes:
{
Gui, CodeWindow:Destroy
return
}
Clear_Log:
{
MsgBox, 4, Clear Log, Are you sure?
IfMsgBox, Yes
{
FileDelete, %OutputLogFile%
OutputText := ""
oMyGUI.Update()
return
}
return
}
Buy_Extra_Chests(chestid,extracount) {
chestparams := DummyData "&user_id=" UserID "&hash=" UserHash "&instance_id=" InstanceID "&chest_type_id=" chestid "&count="
gemsspent := 0
while (extracount > 0) {
SB_SetText("Chests remaining to purchase: " extracount)
if (extracount < 101) {
rawresults := ServerCall("buysoftcurrencychest", chestparams extracount)
extracount -= extracount
}
else {
rawresults := ServerCall("buysoftcurrencychest", chestparams "100")
extracount -= 100
}
chestresults := JSON.parse(rawresults)
if (chestresults.success == "0") {
MsgBox % "Error: " rawresults
UpdateLogTime()
FileAppend, (%CurrentTime%) Gems spent: %gemsspent%`n, %OutputLogFile%
FileRead, OutputText, %OutputLogFile%
oMyGUI.Update()
GetUserDetails()
SB_SetText("Chests remaining: " count " (Error: " chestresults.failure_reason ")")
return
}
gemsspent += chestresults.currency_spent
Sleep 1000
}
UpdateLogTime()
FileAppend, (%CurrentTime%) Gems spent: %gemsspent%`n, %OutputLogFile%
FileRead, OutputText, %OutputLogFile%
SB_SetText("Chest purchase completed.")
return gemsspent
}
Buy_Chests(chestid) {
if !UserID {
MsgBox % "Need User ID & Hash."
FirstRun()
}
if !CurrentGems {
MsgBox, 4, , No gems detected. Check server for user details?
IfMsgBox, Yes
{
GetUserDetails()
}
}
switch chestid
{
case 1: {
maxbuy := Floor(CurrentGems/50)
InputBox, count, Buying Chests, % "How many Silver Chests?`n(Max: " maxbuy ")", , 200, 180
if ErrorLevel
return
if (count > maxbuy) {
MsgBox, 4, , Insufficient gems detected for purchase.`nContinue anyway?
IfMsgBox No
return
}
}
case 2: {
maxbuy := Floor(CurrentGems/500)
InputBox, count, Buying Chests, % "How many Gold Chests?`n(Max: " maxbuy ")", , 200, 180
if ErrorLevel
return
if (count = "alpha5") {
chestparams := DummyData "&user_id=" UserID "&hash=" UserHash "&instance_id=" InstanceID
rawresults := ServerCall("alphachests", chestparams)
MsgBox % rawresults
GetUserDetails()
SB_SetText("Ai yi yi, Zordon!")
return
}
if (count > maxbuy) {
MsgBox, 4, , Insufficient gems detected for purchase.`nContinue anyway?
IfMsgBox No
return
}
}
default: {
MsgBox, Invalid chest_id value.
return
}
}
chestparams := DummyData "&user_id=" UserID "&hash=" UserHash "&instance_id=" InstanceID "&chest_type_id=" chestid "&count="
gemsspent := 0
while (count > 0) {
SB_SetText("Chests remaining to purchase: " count)
if (count < 101) {
rawresults := ServerCall("buysoftcurrencychest", chestparams count)
count -= count
}
else {
rawresults := ServerCall("buysoftcurrencychest", chestparams "100")
count -= 100
}
chestresults := JSON.parse(rawresults)
if (chestresults.success == "0") {
MsgBox % "Error: " rawresults
UpdateLogTime()
FileAppend, (%CurrentTime%) Gems spent: %gemsspent%`n, %OutputLogFile%
FileRead, OutputText, %OutputLogFile%
oMyGUI.Update()
GetUserDetails()
SB_SetText("Chests remaining: " count " (Error: " chestresults.failure_reason ")")
return
}
gemsspent += chestresults.currency_spent
Sleep 1000
}
UpdateLogTime()
FileAppend, (%CurrentTime%) Gems spent: %gemsspent%`n, %OutputLogFile%
FileRead, OutputText, %OutputLogFile%
oMyGUI.Update()
GetUserDetails()
SB_SetText("Chest purchase completed.")
return
}
Open_Chests(chestid) {
if !UserID {
MsgBox % "Need User ID & Hash."
FirstRun()
}
if (!CurrentGolds && !CurrentSilvers && !CurrentGems) {
MsgBox, 4, , No chests or gems detected. Check server for user details?
IfMsgBox, Yes
{
GetUserDetails()
}
}
switch chestid
{
case 1: {
InputBox, count, Opening Chests, % "How many Silver Chests?`n(Owned: " CurrentSilvers ")`n(Max: " (CurrentSilvers + Floor(CurrentGems/50)) ")", , 200, 180
if ErrorLevel
return
if (count > CurrentSilvers) {
MsgBox, 4, , % "Spend " ((count - CurrentSilvers)*50) " gems to purchase " (count - CurrentSilvers) " chests before opening?"
extracount := (count - CurrentSilvers)
IfMsgBox, Yes
extraspent := Buy_Extra_Chests(1,extracount)
else {
return
}
}
}
case 2: {
InputBox, count, Opening Chests, % "How many Gold Chests?`n(Owned: " CurrentGolds ")`n(Max: " (CurrentGolds + Floor(CurrentGems/500)) ")`n`n(Feats earned using this app do not`ncount towards the related achievement.)", , 360, 240
if ErrorLevel
return
if (count > CurrentGolds) {
MsgBox, 4, , % "Spend " ((count - CurrentGolds)*500) " gems to purchase " (count - CurrentGolds) " chests before opening?"
extracount := (count - CurrentGolds)
IfMsgBox, Yes
extraspent := Buy_Extra_Chests(2,extracount)
else {
return
}
}
}
default: {
MsgBox, Invalid chest_id value.
return
}
}