forked from dhusemann/idlecombos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
b.ahk
2859 lines (2731 loc) · 93.1 KB
/
b.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
#include %A_ScriptDir%
#include JSON.ahk
#include idledict.ahk
;1.98
;update idledict content,
;added NERDS as evergreen for equipment screen
;1.97
;include fixes for single instance from mikebaldi
;1.96
;update dict file to latest content and versioned to 1.96
;1.95
;disabled opening chest while client is open,
;1.94
;Updated Cleaned up UI around redeam codes with mikebaldi1980 Help
;added in party 3 and core 3 with code from HPX
;updated Eunomiac code to copy and find code from discord combination channel
;should be robust enough to find chest code in most channel but haven't verified
;1.93
;more work to clean up window for combination code.
;Added in 1.92
;added Eunomiac code to copy and find code from discord combination channel
;Added in 1.91
;Added DeathoEye Server update
;Neal's Json escape code for redeaming codes
;updated dict file to 1.91 champs, chest and feats up to UserDetailsFile
;Added in 1.9
;-Patron Zariel
;-Dictionary file updated to 1.9
;
;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.98"
global CurrentDictionary := "2.00"
;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/dhusemann/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 ServerName := "ps7"
global GetDetailsonStart := 0
global LaunchGameonStart := 0
global FirstRun := 1
global AlwaysSaveChests := 0
global AlwaysSaveContracts := 0
global AlwaysSaveCodes := 0
global NoSaveSetting := 0
global SettingsCheckValue := 11 ;used to check for outdated settings file
global NewSettings := JSON.stringify({"servername":"ps7","firstrun":0,"user_id":0,"hash":0,"instance_id":0,"getdetailsonstart":0,"launchgameonstart":0,"alwayssavechests":1,"alwayssavecontracts":1,"alwayssavecodes":1, "NoSaveSetting":0})
;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 Background2Adventure := ""
global Background2Area := ""
global Background2Patron := ""
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 CurrentTinyBounties := ""
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"
global BG2Core := "`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 := ""
global ZarielVariants := ""
global ZarielCompleted := ""
global ZarielVariantTotal := ""
global ZarielFPCurrency := ""
global ZarielChallenges := ""
global ZarielRequires := ""
global ZarielCosts := ""
;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 := ""
global foundCodeString := ""
;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
ServerName := CurrentSettings.servername
GetDetailsonStart := CurrentSettings.getdetailsonstart
LaunchGameonStart := CurrentSettings.launchgameonstart
AlwaysSaveChests := CurrentSettings.alwayssavechests
AlwaysSaveContracts := CurrentSettings.alwayssavecontracts
AlwaysSaveCodes := CurrentSettings.alwayssavecodes
NoSaveSetting := CurrentSettings.NoSaveSetting
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 := "275" ;"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, End Background2 Adv, EndBG2Adventure
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 h230, 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 w130, Current Adventure:
Gui, MyWindow:Add, Text, vCurrentAdventure x+2 w50, % CurrentAdventure
Gui, MyWindow:Add, Text, x15 y+p w130, Current Patron:
Gui, MyWindow:Add, Text, vCurrentPatron x+2 w50, % CurrentPatron
Gui, MyWindow:Add, Text, x15 y+p w130, Current Area:
Gui, MyWindow:Add, Text, vCurrentArea x+2 w50, % CurrentArea
Gui, MyWindow:Add, Text, x15 y76 w130, Background Adventure:
Gui, MyWindow:Add, Text, vBackgroundAdventure x+2 w50, % BackgroundAdventure
Gui, MyWindow:Add, Text, x15 y+p w130, Background Patron:
Gui, MyWindow:Add, Text, vBackgroundPatron x+2 w50, % BackgroundPatron
Gui, MyWindow:Add, Text, x15 y+p w130, Background Area:
Gui, MyWindow:Add, Text, vBackgroundArea x+2 w50, % BackgroundArea
Gui, MyWindow:Add, Text, x15 y119 w130, Background2 Adventure:
Gui, MyWindow:Add, Text, vBackground2Adventure x+2 w50, % Background2Adventure
Gui, MyWindow:Add, Text, x15 y+p w130, Background2 Patron:
Gui, MyWindow:Add, Text, vBackground2Patron x+2 w50, % Background2Patron
Gui, MyWindow:Add, Text, x15 y+p w130, Background2 Area:
Gui, MyWindow:Add, Text, vBackground2Area x+2 w50, % Background2Area
Gui, MyWindow:Add, Text, vFGCore x200 y33 w150, % FGCore
Gui, MyWindow:Add, Text, vBGCore x200 y76 w150, % BGCore
Gui, MyWindow:Add, Text, vBG2Core x200 y119 w150, % BG2Core
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, Tiny Bounties:
Gui, MyWindow:Add, Text, vCurrentTinyBounties x+2 w35 right, % CurrentTinyBounties
Gui, MyWindow:Add, Text, x15 y+p w110, Small Bounties:
Gui, MyWindow:Add, Text, vCurrentSmBounties x+2 w35 right, % CurrentSmBounties
Gui, MyWindow:Add, Text, vAvailableTokens x+10 w220, % 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 w220, % 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, MyWindow:Add, Text, x15 y+5+p w75, Zariel Variants:
Gui, MyWindow:Add, Text, vZarielVariants x+p w75 right cRed, % ZarielVariants
Gui, MyWindow:Add, Text, x15 y+p w95, Zariel FP Currency:
Gui, MyWindow:Add, Text, vZarielFPCurrency x+p w55 right cRed, % ZarielFPCurrency
Gui, MyWindow:Add, Text, vZarielRequires x+2 w200 right, % ZarielRequires
Gui, MyWindow:Add, Text, x15 y+p w95, Zariel Challenges:
Gui, MyWindow:Add, Text, vZarielChallenges x+p w55 right cRed, % ZarielChallenges
Gui, MyWindow:Add, Text, vZarielCosts x+2 w200 right, % ZarielCosts
Gui, Tab, Champions
Gui, MyWindow:Add, Text, vChampDetails x15 y33 w300 h150, % ChampDetails
Gui, Tab, Settings
Gui, MyWindow:Add, Text,, Server Name:
Gui, MyWindow:Add, Edit, vServerName w50
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, Checkbox, vNoSaveSetting, Never save 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:, Background2Adventure, % Background2Adventure, w250 h210
GuiControl, MyWindow:, Background2Area, % Background2Area, w250 h210
GuiControl, MyWindow:, Background2Patron, % Background2Patron, w250 h210
GuiControl, MyWindow:, FGCore, % FGCore, w250 h210
GuiControl, MyWindow:, BGCore, % BGCore, w250 h210
GuiControl, MyWindow:, BG2Core, % BG2Core, 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:, CurrentTinyBounties, % CurrentTinyBounties, 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
GuiControl, MyWindow:, ZarielVariants, % ZarielVariants, w250 h210
GuiControl, MyWindow:, ZarielChallenges, % ZarielChallenges, w250 h210
GuiControl, MyWindow:, ZarielFPCurrency, % ZarielFPCurrency, w250 h210
GuiControl, MyWindow:, ZarielRequires, % ZarielRequires, w250 h210
GuiControl, MyWindow:, ZarielCosts, % ZarielCosts, w250 h210
;champions
GuiControl, MyWindow:, ChampDetails, % ChampDetails, w250 h210
;settings
GuiControl, MyWindow:, ServerName, % ServerName, w50 h210
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
GuiControl, MyWindow:, NoSaveSetting, % NoSaveSetting, 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.servername := ServerName
CurrentSettings.getdetailsonstart := GetDetailsonStart
CurrentSettings.launchgameonstart := LaunchGameonStart
CurrentSettings.alwayssavechests := AlwaysSaveChests
CurrentSettings.alwayssavecontracts := AlwaysSaveContracts
CurrentSettings.alwayssavecodes := AlwaysSaveCodes
CurrentSettings.nosavesetting := NoSaveSetting
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 Updates by Eldoen`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, 0, , % "Note: It's recommended to close the game client before opening chests."
return
;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, 0, , % "Note: It's recommended to close the game client before opening chests."
return
;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 h230, Codes
Gui, CodeWindow:Add, Edit, r12 vCodestoEnter w190 x20 y20, IDLE-CHAM-PION-SNOW
Gui, CodeWindow:Add, Button, gRedeem_Codes, Submit
Gui, CodeWindow:Add, Button, x+35 gPaste, Paste
Gui, CodeWindow:Add, Button, x+35 gClose_Codes, Close
Gui, CodeWindow:Add, Text, w190 x20 y+5 vCodesPending, Codes Pending: 0
return
}
Paste:
{
getChestCodes()
GuiControl,, CodestoEnter, %foundCodeString%
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
for k, v in CodeList
{
v := StrReplace(v, "`r")
v := StrReplace(v, "`n")
v := Trim(v)
CurrentCode := v
sCode := RegExReplace(CurrentCode, "&", Replacement := "%26")
sCode := RegExReplace(sCode, "#", Replacement := "%23")
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)
rawloot := JSON.stringify(coderesults.loot_details)
codeloot := JSON.parse(rawloot)
}
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 !(CurrentSettings.nosavesetting) {
MsgBox, 4, , "Save to File?"
IfMsgBox, Yes
{
tempsavesetting := 1
FileAppend, %sCode%`n, %RedeemCodeLogFile%
FileAppend, %rawresults%`n, %RedeemCodeLogFile%
}
}
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?