This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathLCL.ahk
869 lines (823 loc) · 28.8 KB
/
LCL.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
;@Ahk2Exe-SetName Lunar Client Lite
;@Ahk2Exe-SetDescription Lunar Client Lite
;@Ahk2Exe-SetVersion 1.6.4
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
ListLines Off
#SingleInstance, Force
#NoTrayIcon
;File Existence Checks
IfNotExist, Config.ini
ConfigCreate()
EnvGet, vHomeDrive, HOMEDRIVE
EnvGet, vHomePath, HOMEPATH
Resources()
UserProfile=% vHomeDrive vHomePath
IfNotExist, %UserProfile%\AppData\Local\Programs\lunarclient\Lunar Client.exe
LCCheck()
LauncherMSA()
;Language
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangFile=english.txt
LangUIFile=englishui.txt
Format=.
}
Else If (Lang = "French"){
LangFile=french.txt
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangFile=arabic.txt
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangFile=georgian.txt
LangUIFile=georgianui.txt
Format="'ის"
}
Else If (Lang = "Spanish"){
LangFile=spanish.txt
LangUIFile=spanishui.txt
}
Else If (Lang="Chinese"){
LangFile=chinese.txt
LangUIFile=chineseui.txt
}
FileEncoding, UTF-8
;Command Line Arguments
Arguments := ["1.7", "1.8", "1.12", "1.16", "1.17"]
for n, param in A_Args ; For each parameter:
{
IniRead, LauncherVer, Config.ini, LC, Launcher_Version
If (param=1.7 or param=1.8 or param=1.12 or param=1.16 or param=1.17){
LCVer=%param%
If (param=1.7){
MCAssetIndex=1.7.10
}
else {
MCAssetIndex=%param%
}
IniRead, Path, Config.ini, Paths, %param%_Dir
Server=%2%
If (Server = ""){
Server=
}
else {
Server=--server %2%
}
}
else
{
FileReadLine, Error1, Resources/lang/%LangUIFile%, 1
FileReadLine, Error2, Resources/lang/%LangUIFile%, 2
FileReadLine, Error3, Resources/lang/%LangUIFile%, 3
MsgBox, 16, %Error1%, %Error2% "%param%" %Error3%
ExitApp
}
EnvGet, vHomeDrive, HOMEDRIVE
EnvGet, vHomePath, HOMEPATH
UserProfile=% vHomeDrive vHomePath
IniRead, LCArgs, Config.ini, LC, Arguments
IniRead, TexturesToggle, Config.ini, LC, Cosmetics
IniRead, Assets, Config.ini, Minecraft, Assets
if (LCVer="1.7"){
Loop, Files, %UserProfile%\.lunarclient\jre\zulu*, D
LaunchJRE=%A_LoopFileLongPath%\bin\javaw.exe
}
else {
IniRead, LaunchJRE, Config.ini, Minecraft, JRE
}
If (TexturesToggle=1) {
Textures=%UserProfile%\.lunarclient\textures
}
Try {
Run, %LaunchJRE% --add-modules jdk.naming.dns --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming -Djna.boot.library.path="%USERPROFILE%\.lunarclient\offline\%LCVer%\natives" --add-opens java.base/java.io=ALL-UNNAMED %LCArgs% -Djava.library.path="%USERPROFILE%\.lunarclient\offline\%LCVer%\natives" -cp "%USERPROFILE%\.lunarclient\offline\%LCVer%\lunar-assets-prod-1-optifine.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\lunar-assets-prod-2-optifine.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\lunar-assets-prod-3-optifine.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\lunar-libs.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\lunar-prod-optifine.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\OptiFine.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\vpatcher-prod.jar" com.moonsworth.lunar.patcher.LunarMain --version %LCVer% --accessToken 0 --assetIndex %MCAssetIndex% --userProperties {} --gameDir "%Path%" --texturesDir "%Textures%" --assetsDir "%Assets%" --launcherVersion %LauncherVer% %Server% --width 854 --height 480
}
Catch Error
MsgBox, 16, Launch Error, Lunar Client Lite couldn't launch Lunar Client.`nCheck your specified Java Executable.
ExitApp
}
Progress=0
;GUI
FileReadLine, Home, Resources/lang/%LangFile%, 1
FileReadLine, Settings, Resources/lang/%LangFile%, 2
FileReadLine, About, Resources/lang/%LangFile%, 3
FileReadLine, Java, Resources/lang/%LangFile%, 4
FileReadLine, Directory, Resources/lang/%LangFile%, 5
FileReadLine, LaunchOptions, Resources/lang/%LangFile%, 6
FileReadLine, Cosmetics, Resources/lang/%LangFile%, 7
FileReadLine, Executable, Resources/lang/%LangFile%, 8
FileReadLine, SYOJETUWLC, Resources/lang/%LangFile%, 9
FileReadLine, Arguments, Resources/lang/%LangFile%, 10
FileReadLine, LCMB, Resources/lang/%LangFile%, 11
FileReadLine, Aetopia, Resources/lang/%LangFile%, 12
FileReadLine, GitHubRepository, Resources/lang/%LangFile%, 13
FileReadLine, RLCL, Resources/lang/%LangFile%, 14
FileReadLine, Reset, Resources/lang/%LangFile%, 15
FileReadLine, OTLF, Resources/lang/%LangFile%, 16
FileReadLine, Open, Resources/lang/%LangFile%, 17
FileReadLine, Language, Resources/lang/%LangFile%, 18
FileReadLine, Translators, Resources/lang/%LangFile%, 19
IniRead, GUIArguments, Config.ini, LC, Arguments
Gui, Main:Default
Gui, -MaximizeBox -MinimizeBox -Resize
;Colors
FileReadLine, Font, Resources/colors, 1
FileReadLine, Background, Resources/colors, 2
FileReadLine, Control, Resources/colors, 3
Gui, Font, s10
Gui, Font, c%Font%
Gui, Color, %Background%, %Control%
Gui, Add, Tab3, w490 h385 x6 Top +Background +0x400 -TabStop, %Home%|%Settings%|Java|%About%
Gui, Font, s8
Gui, Add, Picture, x8 y32, Resources/Banner.png
IniRead, GUIArguments, Config.ini, LC, Arguments
Gui, Tab, 1
Gui, Font, s10
Gui, Add, Picture, x196 y340 w108 h38 gLaunch vLaunchButton, Resources/Launch.png
Gui, Add, Button, x0 y0 w0 h0 gLaunch +default vLaunch
Gui, Font, s8
Gui, Add, DropDownList, x196 y315 w108 h40 vVersionList gVersionWrite c30 r5, 1.7|1.8|1.12|1.16|1.17
VersionRead()
Gui, Tab, 2
IniRead, 17_Path, Config.ini, Paths, 1.7_Dir
IniRead, 18_Path, Config.ini, Paths, 1.8_Dir
IniRead, 112_Path, Config.ini, Paths, 1.12_Dir
IniRead, 116_Path, Config.ini, Paths, 1.16_Dir
IniRead, 117_Path, Config.ini, Paths, 1.17_Dir
IniRead, CosmeticTextures, Config.ini, LC, Cosmetics
Gui, Add, Text,, 1.7 %Directory%
Gui, Add, Edit, w400 h20 v17Dir, %17_Path%
Gui, Add, Text,, 1.8 %Directory%
Gui, Add, Edit, w400 h20 v18Dir, %18_Path%
Gui, Add, Text,, 1.12 %Directory%
Gui, Add, Edit, w400 h20 v112Dir, %112_Path%
Gui, Add, Text,, 1.16 %Directory%
Gui, Add, Edit, w400 h20 v116Dir, %116_Path%
Gui, Add, Text,, 1.17 %Directory%
Gui, Add, Edit, w400 h20 v117Dir, %117_Path%
Gui, Add, Text,, %LaunchOptions%
If (CosmeticTextures = 1){
Gui, Add, Checkbox, Checked vCosmeticDelayFix, %Cosmetics%
}
Else {
Gui, Add, Checkbox, vCosmeticDelayFix, %Cosmetics%
}
Gui, Add, Picture, x425 y58 w23 h22 g17FolderSelect v17Select, Resources/Edit.png
Gui, Add, Picture, x425 y105 w23 h22 g18FolderSelect v18Select, Resources/Edit.png
Gui, Add, Picture, x425 y152 w23 h22 g112FolderSelect v112Select, Resources/Edit.png
Gui, Add, Picture, x425 y199 w23 h22 g116FolderSelect v116Select, Resources/Edit.png
Gui, Add, Picture, x425 y246 w23 h22 g117FolderSelect v117Select, Resources/Edit.png
Gui, Font, s10
Gui, Add, Picture, x380 y342 w98 h38 vSave gSave, Resources/Save_Settings.png
Gui, Font, s8
Gui, Tab, 3
Gui, Add, Text,, %Executable%
IniRead, GUIJRE, Config.ini, Minecraft, JRE
Gui, Add, Edit, h20 w400 vJRE +ReadOnly, %GUIJRE%
Gui, Add, Text,, %SYOJETUWLC%
Gui, Add, Text,, %Arguments%
Gui, Add, Edit, w400 h250 vArgs -0x1000 +0x4 +Wrap +0x100 +Multi, %GUIArguments%
Gui, Add, Picture, x425 y58 w23 h22 gJRESelect vJRESelect, Resources/Edit.png
Gui, Font, s10
Gui, Add, Picture, x425 y134 w58 h34 gSaveJVMArguments vSaveJVMArguments, Resources/Save_JVMArguments.png
Gui, Font, s8
Gui, Tab, 4
Gui, Add, Link,, %LCMB% <a href="https://github.com/Aetopia">%Aetopia%</a>
Gui, Add, Link,, %GitHubRepository%: <a href="https://github.com/Aetopia/Lunar-Client-Lite-Launcher">https://github.com/Aetopia/Lunar-Client-Lite-Launcher</a>
Gui, Add, Link,, Couleur Tweaks Tips Discord: <a href="https://dsc.gg/ctt">https://dsc.gg/ctt</a>
Gui, Add, Text,, %Translators%
Gui, Add, Text, w463 0x10
Gui, Add, Text,, %Reset% Lunar Client Lite%Format%
Gui, Add, Button, gReset, %Reset%
Gui, Add, Text,, %OTLF%
Gui, Add, Button, gLogs, %Open%
Gui, Add, Text,, %Language%:
Gui, Add, DropDownList, vLang gLang, Arabic|Chinese|English|French|Georgian|Spanish
LangSelect()
Gui, Show, w500 h400, Lunar Client Lite
GuiControl, Focus, Launch
GuiControl, Focus, +default
;Functions
Launch() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
GuiControl,, LaunchButton, Resources/Launch_Clicked.png
Sleep, 75
GuiControl,, LaunchButton, Resources/Launch.png
IniRead, LauncherVer, Config.ini, LC, Launcher_Version
EnvGet, vHomeDrive, HOMEDRIVE
EnvGet, vHomePath, HOMEPATH
UserProfile=% vHomeDrive vHomePath
IniRead, LCArgs, Config.ini, LC, Arguments
IniRead, LCVer, Config.ini, LC, Version
IniRead, MCAssetIndex, Config.ini, Minecraft, AssetIndex
IniRead, TexturesToggle, Config.ini, LC, Cosmetics
IniRead, Assets, Config.ini, Minecraft, Assets
VersionCheck()
IniRead, PathVersion, Config.ini, LC, Version
if (LCVer="1.7"){
Loop, Files, %UserProfile%\.lunarclient\jre\zulu*, D
LaunchJRE=%A_LoopFileLongPath%\bin\javaw.exe
}
else {
IniRead, LaunchJRE, Config.ini, Minecraft, JRE
}
IniRead, Path, Config.ini, Paths, %PathVersion%_Dir
Gui, Destroy
If (TexturesToggle=1) {
Textures=%UserProfile%\.lunarclient\textures
}
Try {
Run, %LaunchJRE% --add-modules jdk.naming.dns --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming -Djna.boot.library.path="%USERPROFILE%\.lunarclient\offline\%LCVer%\natives" --add-opens java.base/java.io=ALL-UNNAMED %LCArgs% -Djava.library.path="%USERPROFILE%\.lunarclient\offline\%LCVer%\natives" -cp "%USERPROFILE%\.lunarclient\offline\%LCVer%\lunar-assets-prod-1-optifine.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\lunar-assets-prod-2-optifine.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\lunar-assets-prod-3-optifine.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\lunar-libs.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\lunar-prod-optifine.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\OptiFine.jar";"%USERPROFILE%\.lunarclient\offline\%LCVer%\vpatcher-prod.jar" com.moonsworth.lunar.patcher.LunarMain --version %LCVer% --accessToken 0 --assetIndex %MCAssetIndex% --userProperties {} --gameDir "%Path%" --texturesDir "%Textures%" --assetsDir "%Assets%" --launcherVersion %LauncherVer% --width 854 --height 480
ExitApp
}
Catch Error
FileReadLine, ErrorLCLCMD1, Resources/lang/%LangUIFile%, 4
FileReadLine, ErrorLCLCMD2, Resources/lang/%LangUIFile%, 5
MsgBox, 16, Error, %ErrorLCLCMD1%`n%ErrorLCLCMD2%
ExitApp
}
LangSelect(){
IniRead, Lang, Config.ini, Language, Language
If (Lang = "Arabic"){
GuiControl, Choose, Lang, 1
}
Else If (Lang = "Chinese"){
GuiControl, Choose, Lang, 2
}
Else If (Lang = "English"){
GuiControl, Choose, Lang, 3
}
Else If (Lang = "French"){
GuiControl, Choose, Lang, 4
}
Else If (Lang = "Georgian"){
GuiControl, Choose, Lang, 5
}
Else If (Lang = "Spanish"){
GuiControl, Choose, Lang, 6
}
}
LauncherMSA(){
IfNotExist, Resources/cache
FileCreateDir, Resources/cache
FileDelete, Resources/cache/latest.yml
URLDownloadToFile, https://launcherupdates.lunarclientcdn.com/latest.yml, Resources/cache/latest.yml
FileReadLine, LauncherYML, Resources/cache/latest.yml, 1
StringTrimLeft, LauncherVer, LauncherYML, 9
IniWrite, %LauncherVer%, Config.ini, LC, Launcher_Version
}
ConfigCreate() {
IniWrite, 1.8, Config.ini, LC, Version
IniWrite, 1.8, Config.ini, Minecraft, AssetIndex
IniWrite, -Xms3G -Xmx3G -XX:+DisableAttachMechanism, Config.ini, LC, Arguments
IniWrite, 1, Config.ini, LC, Cosmetics
IniWrite, %A_AppData%\.minecraft\assets, Config.ini, Minecraft, Assets
IniWrite, English, Config.ini, Language, Language
EnvGet, vHomeDrive, HOMEDRIVE
EnvGet, vHomePath, HOMEPATH
UserProfile=% vHomeDrive vHomePath
Loop, Files, %UserProfile%\.lunarclient\jre\zulu*, D
IniWrite, %A_LoopFileLongPath%\bin\javaw.exe, Config.ini, Minecraft, JRE
PathConfig()
}
Lang(){
GuiControlGet, LangList,, Lang
IniWrite, %LangList%, Config.ini, Language, Language
Reload
}
Resources() {
IfNotExist, %A_WorkingDir%\Resources
FileCreateDir, %A_WorkingDir%\Resources
IfNotExist, %A_WorkingDir%\Resources\lang
FileCreateDir, %A_WorkingDir%\Resources\lang
IfNotExist, Resources\Banner.png
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/Banner.png, Resources/Banner.png
IfNotExist, Resources\Edit.png
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/Edit.png, Resources/Edit.png
IfNotExist, Resources\Edit_Clicked.png
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/Edit_Clicked.png, Resources/Edit_Clicked.png
IfNotExist, Resources\Launch.png
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/Launch.png, Resources/Launch.png
IfNotExist, Resources\Launch_Clicked.png
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/Launch_Clicked.png, Resources/Launch_Clicked.png
IfNotExist, Resources\Save_JVMArguments.png
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/Save_JVMArguments.png, Resources/Save_JVMArguments.png
IfNotExist, Resources\Save_JVMArguments_Clicked.png
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/Save_JVMArguments_Clicked.png, Resources/Save_JVMArguments_Clicked.png
IfNotExist, Resources\Save_Settings.png
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/Save_Settings.png, Resources/Save_Settings.png
IfNotExist, Resources\Save_Settings_Clicked.png
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/Save_Settings_Clicked.png, Resources/Save_Settings_Clicked.png
IfNotExist, Resources\colors
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/colors, Resources/colors
IfNotExist, Resources\lang\english.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/english.txt, Resources/lang/english.txt
IfNotExist, Resources\lang\arabic.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/arabic.txt, Resources/lang/arabic.txt
IfNotExist, Resources\lang\french.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/french.txt, Resources/lang/french.txt
IfNotExist, Resources\lang\georgian.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/georgian.txt, Resources/lang/georgian.txt
IfNotExist, Resources\lang\chinese.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/chinese.txt, Resources/lang/chinese.txt
IfNotExist, Resources\lang\spanish.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/spanish.txt, Resources/lang/spanish.txt
IfNotExist, Resources\lang\englishui.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/englishui.txt, Resources/lang/englishui.txt
IfNotExist, Resources\lang\arabicui.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/arabicui.txt, Resources/lang/arabicui.txt
IfNotExist, Resources\lang\frenchui.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/frenchui.txt, Resources/lang/frenchui.txt
IfNotExist, Resources\lang\georgianui.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/georgianui.txt, Resources/lang/georgianui.txt
IfNotExist, Resources\lang\chineseui.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/chineseui.txt, Resources/lang/chineseui.txt
IfNotExist, Resources\lang\spanishui.txt
URLDownloadToFile, https://raw.githubusercontent.com/Aetopia/Lunar-Client-Lite-Launcher/main/Resources/lang/spanishui.txt, Resources/lang/spanishui.txt
}
VersionWrite() {
GuiControlGet, UserVersion,, VersionList
If (UserVersion = 1.7 or UserVersion = 1.8 or UserVersion = 1.12 or UserVersion = 1.16 or UserVersion = 1.17)
{
IniWrite, %UserVersion%, Config.ini, LC, Version
If (UserVersion = 1.7) {
IniWrite, 1.7.10, Config.ini, Minecraft, AssetIndex
}
Else {
IniWrite, %UserVersion%, Config.ini, Minecraft, AssetIndex
}
}
return
}
VersionRead() {
IniRead, GUIVersion, Config.ini, LC, Version
If (GUIVersion = 1.7)
{
GuiControl, Choose, VersionList, 1
}
Else If (GUIVersion = 1.8)
{
GuiControl, Choose, VersionList, 2
}
Else If (GUIVersion = 1.12)
{
GuiControl, Choose, VersionList, 3
}
Else If (GUIVersion = 1.16)
{
GuiControl, Choose, VersionList, 4
}
Else If (GUIVersion = 1.17)
{
GuiControl, Choose, VersionList, 5
}
return
}
LCCheck() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
FileReadLine, ErrorLC1, Resources/lang/%LangUIFile%, 6
FileReadLine, ErrorLC2, Resources/lang/%LangUIFile%, 7
FileReadLine, ErrorLC3, Resources/lang/%LangUIFile%, 8
FileReadLine, ErrorLC4, Resources/lang/%LangUIFile%, 9
;MsgBox, 16, %ErrorLC1%, %ErrorLC2%`n%ErrorLC3%
Gui, Install:New
Gui, -MaximizeBox -MinimizeBox +0x40000
Gui, Add, Progress, w200 h20 vProgress cGreen, 20
Gui, Add, Text,, %ErrorLC4%
Gui, Show,, Lunar Client Lite
LauncherMSA()
IniRead, LauncherVer, Config.ini, LC, Launcher_Version
URLDownloadToFile, https://launcherupdates.lunarclientcdn.com/Lunar Client v%LauncherVer%.exe, %A_Temp%\lunar.exe
GuiControl,, Progress, +100
Sleep 500
Gui, Destroy
IfNotExist, %A_Temp%\lunar.exe
LCNotExist()
Run, %A_Temp%\lunar.exe
Process, Exist, lunar.exe
WinActivate, ahk_exe lunar.exe
ExitApp
}
LCNotExist() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
FileReadLine, NotExistLCL1, Resources/lang/%LangUIFile%, 10
FileReadLine, NotExistLCL2, Resources/lang/%LangUIFile%, 11
FileReadLine, NotExistLCL3, Resources/lang/%LangUIFile%, 12
Gui,Destroy
MsgBox, 16, %NotExistLCL1%, %NotExistLCL2%`n%NotExistLCL3%
ExitApp
}
VersionCheck() {
IniRead, CheckVersion, Config.ini, LC, Version
EnvGet, vHomeDrive, HOMEDRIVE
EnvGet, vHomePath, HOMEPATH
UserProfile=% vHomeDrive vHomePath
If (CheckVersion = 1.7){
IfNotExist, %UserProfile%\.lunarclient\offline\1.7
FileCheck(1.7)
return
}
If (CheckVersion = 1.8){
IfNotExist, %UserProfile%\.lunarclient\offline\1.8
FileCheck(1.8)
return
}
If (CheckVersion = 1.9){
IfNotExist, %UserProfile%\.lunarclient\offline\1.9
FileCheck(1.9)
return
}
If (CheckVersion = 1.12){
IfNotExist, %UserProfile%\.lunarclient\offline\1.12
FileCheck(1.12)
return
}
If (CheckVersion = 1.16){
IfNotExist, %UserProfile%\.lunarclient\offline\1.16
FileCheck(1.16)
return
}
If (CheckVersion = 1.17){
IfNotExist, %UserProfile%\.lunarclient\offline\1.17
FileCheck(1.17)
return
}
}
FileCheck(n) {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
EnvGet, vHomeDrive, HOMEDRIVE
EnvGet, vHomePath, HOMEPATH
UserProfile=% vHomeDrive vHomePath
FileReadLine, NotExistLCVer1, Resources/lang/%LangUIFile%, 13
FileReadLine, NotExistLCVer2, Resources/lang/%LangUIFile%, 14
FileReadLine, NotExistLCVer3, Resources/lang/%LangUIFile%, 15
MsgBox, 16, %NotExistLCVer1%, LC %n% %NotExistLCVer2%`n%NotExistLCVer3% %n%!
Run, %UserProfile%\AppData\Local\Programs\lunarclient\Lunar Client.exe
ExitApp
}
NotExist(x) {
if (x=1) {
MsgBox, 16, Download Failed, The dependency could not be downloaded.`nCheck your internet connection.
ExitApp
}
if (x=2) {
MsgBox, 16, Download Failed, Failed to update dependencies.`nCheck your internet connection.
}
}
Logs() {
GuiControl, Focus, Button
IfExist, %A_WorkingDir%\logs
Run, %A_WorkingDir%\logs,, Max
IfNotExist, %A_WorkingDir%\logs
FileCreateDir, %A_WorkingDir%\logs
Run, %A_WorkingDir%\logs,, Max
}
Reset() {
FileDelete, Config.ini
FileRemoveDir, Resources, 1
Reload
}
MainGuiClose() {
ExitApp
}
;Options
;------------------------------------------------------------------------------------
PathConfig() {
IniWrite, %A_AppData%\.minecraft, Config.ini, Paths, 1.7_Dir
IniWrite, %A_AppData%\.minecraft, Config.ini, Paths, 1.8_Dir
IniWrite, %A_AppData%\.minecraft, Config.ini, Paths, 1.12_Dir
IniWrite, %A_AppData%\.minecraft, Config.ini, Paths, 1.16_Dir
IniWrite, %A_AppData%\.minecraft, Config.ini, Paths, 1.17_Dir
}
17FolderSelect() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
FileReadLine, SelectDirectory, Resources/lang/%LangUIFile%, 16
GuiControl,, 17Select, Resources/Edit_Clicked.png
Sleep, 100
GuiControl,, 17Select, Resources/Edit.png
IniRead, 17_Path, Config.ini, Paths, 1.7_Dir
FileSelectFolder, 17PathSelected, *%17_Path%, 3, %SelectDirectory% 1.7
if 17PathSelected =
return
else
guicontrol,, 17Dir, %17PathSelected%
}
18FolderSelect() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
FileReadLine, SelectDirectory, Resources/lang/%LangUIFile%, 16
GuiControl,, 18Select, Resources/Edit_Clicked.png
Sleep, 100
GuiControl,, 18Select, Resources/Edit.png
IniRead, 18_Path, Config.ini, Paths, 1.8_Dir
FileSelectFolder, 18PathSelected, *%18_Path%, 3, %SelectDirectory% 1.8
if 18PathSelected =
return
else
guicontrol,, 18Dir, %18PathSelected%
}
112FolderSelect() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
FileReadLine, SelectDirectory, Resources/lang/%LangUIFile%, 16
GuiControl,, 112Select, Resources/Edit_Clicked.png
Sleep, 100
GuiControl,, 112Select, Resources/Edit.png
IniRead, 112_Path, Config.ini, Paths, 1.12_Dir
FileSelectFolder, 112PathSelected, *%112_Path%, 3, %SelectDirectory% 1.12
if 112PathSelected =
return
else
guicontrol,, 112Dir, %112PathSelected%
}
116FolderSelect() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
FileReadLine, SelectDirectory, Resources/lang/%LangUIFile%, 16
GuiControl,, 116Select, Resources/Edit_Clicked.png
Sleep, 100
GuiControl,, 116Select, Resources/Edit.png
FileSelectFolder, 116PathSelected, *%116_Path%, 3, %SelectDirectory% 1.16
if 116PathSelected =
return
else
guicontrol,, 116Dir, %116PathSelected%
}
117FolderSelect() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
FileReadLine, SelectDirectory, Resources/lang/%LangUIFile%, 16
GuiControl,, 117Select, Resources/Edit_Clicked.png
Sleep, 100
GuiControl,, 117Select, Resources/Edit.png
IniRead, 117_Path, Config.ini, Paths, 1.17_Dir
FileSelectFolder, 117PathSelected, *%117_Path%, 3, %SelectDirectory% 1.17
if 117PathSelected =
return
else
guicontrol,, 117Dir, %117PathSelected%
}
Save() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
FileReadLine, SaveText1, Resources/lang/%LangUIFile%, 17
FileReadLine, SaveText2, Resources/lang/%LangUIFile%, 18
GuiControl,, Save, Resources/Save_Settings_Clicked.png
Sleep, 100
GuiControl,, Save, Resources/Save_Settings.png
guicontrolget, 17Path,, 17Dir
guicontrolget, 18Path,, 18Dir
guicontrolget, 112Path,, 112Dir
guicontrolget, 116Path,, 116Dir
guicontrolget, 117Path,, 117Dir
guicontrolget, TextureLoad,, CosmeticDelayFix
IniWrite, %17Path%, Config.ini, Paths, 1.7_Dir
IniWrite, %18Path%, Config.ini, Paths, 1.8_Dir
IniWrite, %112Path%, Config.ini, Paths, 1.12_Dir
IniWrite, %116Path%, Config.ini, Paths, 1.16_Dir
IniWrite, %117Path%, Config.ini, Paths, 1.17_Dir
IniWrite, %TextureLoad%, Config.ini, LC, Cosmetics
MsgBox, 64, %SaveText1%, %SaveText2%, 1
}
SaveJVMArguments() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
FileReadLine, SaveText1, Resources/lang/%LangUIFile%, 17
FileReadLine, SaveText2, Resources/lang/%LangUIFile%, 18
GuiControl,, SaveJVMArguments, Resources/Save_JVMArguments_Clicked.png
Sleep, 100
GuiControl,, SaveJVMArguments, Resources/Save_JVMArguments.png
GuiControlGet, JVMArgs,, Args
IniWrite, %JVMArgs%, Config.ini, LC, Arguments
MsgBox, 64, %SaveText1%, %SaveText2%, 1
}
;Experiments
JRESelect() {
IniRead, Lang, Config.ini, Language, Language
If (Lang = "English"){
LangUIFile=englishui.txt
}
Else If (Lang = "French"){
LangUIFile=frenchui.txt
}
Else If (Lang = "Arabic"){
LangUIFile=arabicui.txt
}
Else If (Lang = "Georgian"){
LangUIFile=georgianui.txt
}
Else If (Lang = "Spanish"){
LangUIFile=spanishui.txt
}
Else If (Lang = "Chinese"){
LangUIFile=chineseui.txt
}
FileReadLine, Java1, Resources/lang/%LangUIFile%, 19
FileReadLine, Java2, Resources/lang/%LangUIFile%, 20
GuiControl,, JRESelect, Resources/Edit_Clicked.png
Sleep, 100
GuiControl,, JRESelect, Resources/Edit.png
IniRead, SavedJRE, Config.ini, Minecraft, JRE
FileSelectFile, SelectedJRE, 1, %SavedJRE%, %Java1%, %Java2% (javaw.exe)
if SelectedJRE=
return
else
IniWrite, %SelectedJRE%, Config.ini, Minecraft, JRE
guicontrol,, JRE, %SelectedJRE%
}