-
Notifications
You must be signed in to change notification settings - Fork 2
/
Patcher with Mouse.bat
1440 lines (1379 loc) · 30.7 KB
/
Patcher with Mouse.bat
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
:: Bienvenidos a mi desastre
:: Made In Venezuela
:: By ViktorMax3
:: set encode to OEM 850 first
@echo off
SET version=Ver. 1.2
CHCP 850 >NUL
COLOR A0
SET NameG=Super Mario Galaxy
TITLE %NameG% Riivolution to WBFS
MODE con: cols=56 lines=45
CD "%~dp0"
SET WSTRT=bin\wstrt
SET WIT=bin\wit
SET RAR=bin\rar
SET Md5=bin\Md5 -c
SET RM=bin\rm -rf
SET BG=bin\bg
SET udec=bin\udec
SET "echo=%BG% print"
SET WGET=bin\wget
SET Plus=SET /A Num=Num+1
SET Plus2=SET /A Num2=Num2+1
SET CFG=.\config.bat
IF EXIST %CFG% (
CALL %CFG%
)
:: to clear files in the case of FC the script before build game
SET Clear=".\Clear.bat"
%BG% CURSOR 0
SET RiivDir=.\riiv_mods\
SET BoxT= /==============================================\
SET BoxE= I I
SET BoxB= \==============================================/
SET req1=8192
SET req2=4096
SET f_1=8GB
SET f_2=4GB
SET On=SETlocal enableDelayedExpansion
SET Off=SETlocal disableDelayedExpansion
:: Script need turn off-on delayedexpansion
%On%
SET NL=^
:SelectLang
IF DEFINED XX (
CALL :%XX%Strings
GOTO :Magic
)
COLOR E0
SET Num=0
CLS
:: If you add another language in this echo need a edit SET Num=10 in label :ClickLang to SET Num=11
ECHO %version%!NL!
ECHO %BoxT%
ECHO I %NameG% Riivolution to WBFS I
ECHO I Contact: viktormax3@gmail.com I
ECHO %BoxE%
ECHO I W„hlen Sie die Sprache fr das Skript I
ECHO I Select the language for the Script I
ECHO I Seleccione el idioma para el Script I
ECHO %BoxB%!NL!
%Plus%
ECHO %Num%^) Deutsch
%Plus%
ECHO %Num%^) English
%Plus%
ECHO %Num%^) Espa¤ol
:ClickLang
CALL :BGFunc
SET Num=10
%Plus%
IF "%Row%"=="!Num!" (
CALL :DEStrings
)
%Plus%
IF "%Row%"=="!Num!" (
CALL :ENStrings
)
%Plus%
IF "%Row%"=="!Num!" (
CALL :ESStrings
)
IF DEFINED XX (
CALL :%XX%Strings
GOTO :Magic
)
GOTO :clickLang
:ResetVar
SET E1=
SET P1=
SET J1=
SET E2=
SET P2=
SET J2=
SET F1=
SET F2=
SET Patch=
SET RMGE=
SET RMGP=
SET RMGJ=
SET SB4E=
SET SB4P=
SET SB4J=
SET GOTO=
SET Down=
SET GameID=
SET KMGX01=
SET TGSX01=
SET NMGX01=
SET M64X01=
SET NGSX01=
SET TLLX01=
SET MG1X01=
SET MG2X01=
EXIT /B
:Magic
CLS
SET SMG=
SET Found=
::reset variables due have changes before start script
IF "%ResetVar%"=="1" (
CALL :ResetVar
)
SET ResetVar=1
:: %~1 variable are cleaned after progress script
IF NOT DEFINED Droped (
SET Droped=%~f1
)
IF "%Droped%" NEQ "" (
%WIT% LS -Hr '%Droped%' | findstr /i "\<RMG \<SB4" >NUL && (
COLOR A0
ECHO Drag and Drop file
%WIT% LS -Hr '%Droped%'
%BG% SLEEP 1500
SET DropDir=Yes
) || (
COLOR C0
ECHO Invalid Drag and Drop
SET DropDir=No
%BG% SLEEP 1500
)
) ELSE (
SET DropDir=No
)
IF EXIST %Clear% (
ECHO.
ECHO %BoxT%
ECHO !Wait%XX%!
ECHO %BoxB%
CALL %Clear% && (
%RM% %Clear%
)
)
:: WIT are bugged no set many errors to %errorlevel%, partial fix: findstr correct files to filter no compatible drag and drop
CLS
COLOR A0
ECHO !Header%XX%!
ECHO %BoxT%
ECHO !AutoTry%XX%!
ECHO %BoxB%
IF NOT EXIST %CFG% (
Call :SetConfig
)
IF "%SettingsV%" NEQ "1" (
%RM% %CFG%
GOTO :Magic
)
IF "%DropDir%"=="Yes" (
SET folder="%Droped%"
)
IF "%DropDir%"=="No" (
SET folder=".\\"
)
SET WitFlist=%WIT% flist -r %folder% --rdepth 5 -X ".\bin" -n
FOR /F "delims==" %%1 in ('%WitFlist% RMGE01') do SET E1=%%1& SET F1=1+& SET RMGE=1+
FOR /F "delims==" %%2 in ('%WitFlist% RMGP01') do SET P1=%%2& SET F1=1+& SET RMGP=1+
FOR /F "delims==" %%3 in ('%WitFlist% RMGJ01') do SET J1=%%3& SET F1=1+& SET RMGJ=1+
FOR /F "delims==" %%4 in ('%WitFlist% SB4E01') do SET E2=%%4& SET F2=2+& SET SB4E=1+
FOR /F "delims==" %%5 in ('%WitFlist% SB4P01') do SET P2=%%5& SET F2=2+& SET SB4P=1+
FOR /F "delims==" %%6 in ('%WitFlist% SB4J01') do SET J2=%%6& SET F2=2+& SET SB4J=1+
SET /A Detected=%RMGE%%RMGP%%RMGJ%%SB4E%%SB4P%%SB4J%0
SET /A Found=%F1%%F2%0
IF "%Detected%" GEQ "2" (
GOTO :IsoFound
)
IF %Found%==0 (
GOTO :NoGame
)
IF %Found%==1 (
IF DEFINED E1 SET IsoFile="%E1%"
IF DEFINED P1 SET IsoFile="%P1%"
IF DEFINED J1 SET IsoFile="%J1%"
)
IF %Found%==2 (
IF DEFINED E2 SET IsoFile="%E2%"
IF DEFINED P2 SET IsoFile="%P2%"
IF DEFINED J2 SET IsoFile="%J2%"
)
SET SMG=%Found%
GOTO :VerifySpace
:EchoHeader
CLS
SET Num=1
ECHO !Header%XX%!
COLOR E0
ECHO %BoxT%
IF "%Found%" LEQ "2" (
ECHO !Found1%XX%!
)
IF "%Found%"=="3" (
ECHO !Found2%XX%!
)
ECHO %BoxE%
IF "%Found%" LEQ "2" (
ECHO I %NameG% %Found% I
)
IF "%Found%"=="3" (
ECHO I %NameG% 1 %NameG% 2 I
)
ECHO %BoxE%
EXIT /B
:IsoFound
CALL :EchoHeader
ECHO !2Header1%XX%!
ECHO %BoxB%!NL!
ECHO !GameDisp%XX%!
ECHO.
IF DEFINED E1 (
%Plus%
ECHO %Num%^) SMG1 USA
)
IF DEFINED P1 (
%Plus%
ECHO %Num%^) SMG1 PAL
)
IF DEFINED J1 (
%Plus%
ECHO %Num%^) SMG1 JAP
)
IF DEFINED E2 (
%Plus%
ECHO %Num%^) SMG2 USA
)
IF DEFINED P2 (
%Plus%
ECHO %Num%^) SMG2 PAL
)
IF DEFINED J2 (
%Plus%
ECHO %Num%^) SMG2 JAP
)
ECHO.
ECHO R^) !Refresh%XX%!
ECHO S^) !GoCfg%XX%!
ECHO.
ECHO !ClickOption%XX%!
:ClickGame
CALL :BGFunc
SET Num=20
IF DEFINED E1 (
%Plus%
IF "%Row%"=="%Num%" (
SET IsoFile="%E1%"
SET SMG=1
)
)
IF DEFINED P1 (
%Plus%
IF "%Row%"=="%Num%" (
SET IsoFile="%P1%"
SET SMG=1
)
)
IF DEFINED J1 (
%Plus%
IF "%Row%"=="%Num%" (
SET IsoFile="%J1%"
SET SMG=1
)
)
IF DEFINED E2 (
%Plus%
IF "%Row%"=="%Num%" (
SET IsoFile="%E2%"
SET SMG=2
)
)
IF DEFINED P2 (
%Plus%
IF "%Row%"=="%Num%" (
SET IsoFile="%P2%"
SET SMG=2
)
)
IF DEFINED J2 (
%Plus%
IF "%Row%"=="%Num%" (
SET IsoFile="%J2%"
SET SMG=2
)
)
IF "%SMG%" NEQ "" (
GOTO :VerifySpace
)
%Plus%
IF "%Row%"=="%Num%" (
GOTO :Magic
)
%Plus%
IF "%Row%"=="%Num%" (
GOTO :EchoConfig
)
GOTO :ClickGame
:VerifySpace
:: Verify the free space to build mods
:: Fixed to disks over 999GB and space -1MB
SET GOTO=
Set len=
SET ReqS=!F_%SMG%!
FOR /F "tokens=3" %%x in ('DIR %~d0\ /-C /-O /W') do (
SET "s=#%%x"
SET free=%%x
)
FOR %%N in (32 16 8 4 2 1) do (
if "!s:~%%N,1!" NEQ "" (
SET /a "len+=%%N"
SET "s=!s:~%%N!"
)
)
IF %len% geq 10 (
SET Unit=GB
SET Space=%free:~0,1%
IF %free:~0,-6% LEQ !req%SMG%! (
CALL :NoSpace
)
)
IF %len% LSS 10 (
SET Space=%free:~0,3%
IF %len% GTR 6 (
SET Unit=MB
CALL :NoSpace
)
)
IF %len% LSS 7 (
IF %len% GTR 3 (
SET Unit=KB
CALL :NoSpace
)
)
IF %len% LSS 4 (
SET Unit=Bytes
CALL :NoSpace
)
IF DEFINED GOTO (
GOTO :%GOTO%
)
COLOR E0
GOTO :EchoModCaller
:NoSpace
CLS
COLOR C0
ECHO !Header%XX%!
ECHO !NoSpace%XX%:XXX=%ReqS%!
ECHO !Space! !Unit!
GOTO :ClickSpace
EXIT /B
::Falta poner retry y volver
:ClickSpace
CALL :BGFunc
IF %Row% GTR 11 (
IF %Row% LSS 16 (
SET GOTO=VerifySpace
)
)
IF DEFINED GOTO (
EXIT /B
)
GOTO :ClickSpace
:SetMod
SET Num=0
COLOR E0
IF "%SMG%"=="1" (
IF %Down% EXIST "%RiivDir%kmg.riiv" (
SET KMGX01=Kaizo Mario Galaxy
!Plus!
ECHO !Num!^) !KMGX01!
)
IF %Down% EXIST "%RiivDir%tgs.riiv" (
SET TGSX01=SMG1 The Green Stars
!Plus!
ECHO !Num!^) !TGSX01!
)
)
IF "%SMG%"=="2" (
IF %Down% EXIST "%RiivDir%nmg.riiv" (
SET NMGX01=Neo Mario Galaxy
!Plus!
ECHO !Num!^) !NMGX01!
)
IF %Down% EXIST "%RiivDir%m64.riiv" (
SET M64X01=SMG64 Holiday Special
!Plus!
ECHO !Num!^) !M64X01!
)
IF %Down% EXIST "%RiivDir%ngs.riiv" (
SET NGSX01=SMG2 The New Green Star
!Plus!
ECHO !Num!^) !NGSX01!
)
IF %Down% EXIST "%RiivDir%tll.riiv" (
SET TLLX01=SMG2 The Lost Levels
!Plus!
ECHO !Num!^) !TLLX01!
)
IF %Down% EXIST "%RiivDir%mg1.riiv" (
SET MG1X01=Super Mayro Galaxy
!Plus!
ECHO !Num!^) !MG1X01!
)
IF %Down% EXIST "%RiivDir%mg2.riiv" (
SET MG2X01=Super Mayro Galaxy Twoad
!Plus!
ECHO !Num!^) !MG2X01!
)
)
IF "%Down%" NEQ "NOT" (
IF "!NUM!"=="0" (
CLS
COLOR E0
ECHO !Header%XX%!
ECHO %BoxT%
ECHO !NoMods%XX%!
ECHO %BoxE%
%ECHO% !DownExit%XX%!
ECHO %BoxB%
CALL :DownExit
SET GOTO=!GOTO!
)
) ELSE (
IF "!NUM!"=="0" (
CLS
ECHO !Header%XX%!
COLOR A0
ECHO %BoxT%
ECHO !AllMods%XX%!
ECHO %BoxB%
%BG% SLEEP 2500 >NUL
SET GOTO=Magic
)
)
::IF "%SMG%"=="%RiivDir%%IDMod%.riiv" (
:: IF %Down% EXIST ".\namemod.riiv" (
:: SET ID_MOD=Internal_Name
:: !Plus!
:: ECHO !Num!^) !MG2X01!
:: )
::)
EXIT /B
:EchoModCaller
SET GOTO=
CALL :EchoHeader
ECHO !2Header2%XX%!
ECHO %BoxB%!NL!
ECHO !ModDisp%XX%!
ECHO.
CALL :SetMod
IF DEFINED GOTO (
SET GOTO=
GOTO :%GOTO%
)
ECHO.
ECHO D^) !DownMod%XX%!
IF "%Detected%" GEQ "2" (
ECHO R^) !GoBack%XX%!
) ELSE (
ECHO S^) !GoCfg%XX%!
)
ECHO X^) !Exit%XX%!
ECHO.
ECHO !ClickOption%XX%!
GOTO :ClickModCaller
:ClickMods
CALL :BGFunc
SET Num=20
IF DEFINED KMGX01 (
%Plus%
IF "%Row%"=="%Num%" (
SET GOTO=KMGX01
)
)
IF DEFINED TGSX01 (
%Plus%
IF "%Row%"=="%Num%" (
SET GOTO=TGSX01
)
)
IF DEFINED NMGX01 (
%Plus%
IF "%Row%"=="%Num%" (
SET GOTO=NMGX01
)
)
IF DEFINED M64X01 (
%Plus%
IF "%Row%"=="%Num%" (
SET GOTO=M64X01
)
)
IF DEFINED NGSX01 (
%Plus%
IF "%Row%"=="%Num%" (
SET GOTO=NGSX01
)
)
IF DEFINED TLLX01 (
%Plus%
IF "%Row%"=="%Num%" (
SET GOTO=TLLX01
)
)
IF DEFINED MG1X01 (
%Plus%
IF "%Row%"=="%Num%" (
SET GOTO=MG1X01
)
)
IF DEFINED MG2X01 (
%Plus%
IF "%Row%"=="%Num%" (
SET GOTO=MG2X01
)
)
EXIT /B
:ClickModCaller
CALL :ClickMods
%Plus%
IF "%Row%"=="%Num%" (
SET GOTO=DownMods
)
%Plus%
IF "%Detected%" GEQ "2" (
IF "%Row%"=="%Num%" (
SET GOTO=Magic
)
) ELSE (
IF "%Row%"=="%Num%" (
SET GOTO=EchoConfig
)
)
%Plus%
IF "%Row%"=="%Num%" (
EXIT
)
IF DEFINED GOTO (
SET GOTO=
GOTO :%GOTO%
)
GOTO :ClickModCaller
:DownMods
CALL :EchoHeader
ECHO !2Header3%XX%!
ECHO %BoxB%!NL!
CALL :ResetVar
SET Down=NOT
ECHO !DownDisp%XX%!
ECHO.
CALL :SetMod
IF DEFINED GOTO (
SET GOTO=
GOTO :%GOTO%
)
ECHO.
ECHO R^) !GoBack%XX%!!NL!
ECHO !ClickOption%XX%!
:ClickDown
CALL :ClickMods
%Plus%
IF "%Row%"=="%Num%" (
SET GOTO=Magic
)
IF DEFINED GOTO (
SET GOTO=
GOTO :%GOTO%
)
GOTO :ClickDown
:HeaderConfig
CALL :EchoHeader
SET Num=19
ECHO !2Header4%XX%!
ECHO %BoxB%
ECHO.
ECHO !ConfigSelect%XX%!
ECHO.
EXIT /B
:EchoConfig
CALL :HeaderConfig
ECHO 1^) !ConfigLanguage%XX%!= %XX%
ECHO 2^) !ConfigEXT%XX%!= %EXT%
ECHO 3^) !ConfigBanner%XX%!= %Banner%
ECHO 4^) !ConfigMD5%XX%!= %CheckMD5%
ECHO 5^) !ConfigServer%XX%!= %Server%
ECHO.
ECHO S^) !ConfigSave%XX%!
ECHO R^) !GoBack%XX%!!NL!
ECHO !ClickOption%XX%!
:ClickConfig
CALL :BGFunc
SET Num=19
SET Opc=
SET Opc1=
SET Opc2=
SET Opc3=
SET Opc4=
SET Opc5=
SET OpcX=
SET NEW=
%Plus%
IF "%Row%"=="%Num%" (
SET Value=!ConfigLanguage%XX%!
SET Opc=XX
REM SET Opc1=DE
SET Opc2=EN
SET Opc3=ES
)
%Plus%
IF "%Row%"=="%Num%" (
SET Value=!ConfigEXT%XX%!
SET Opc=EXT
SET Opc1=wbfs
SET Opc2=iso
SET Opc3=ciso
SET Opc4=wdf
SET Opc5=wia
)
%Plus%
IF "%Row%"=="%Num%" (
SET Value=!ConfigBanner%XX%!
SET Opc=Banner
SET Opc1=Yes
SET Opc2=No
)
%Plus%
IF "%Row%"=="%Num%" (
SET Value=!ConfigMD5%XX%!
SET Opc=CheckMD5
SET Opc1=Yes
SET Opc2=No
)
%Plus%
IF "%Row%"=="%Num%" (
SET Value=!ConfigServer%XX%!
SET Opc=Server
SET Opc1=Gdrive
SET Opc2=DropBox
)
%Plus%
%Plus%
IF "%Row%"=="%Num%" (
CALL :SetConfig
GOTO :Magic
)
%Plus%
IF "%Row%"=="%Num%" (
GOTO :Magic
)
IF DEFINED Opc (
GOTO :EchoConfig2
)
GOTO :ClickConfig
:EchoConfig2
CALL :HeaderConfig
SET NUM2=1
ECHO %Value% !ConfigValue%XX%!= !%Opc%!
ECHO.
IF DEFINED Opc1 (
%Plus2%
ECHO %NUM2%^) %OPC1%
)
IF DEFINED Opc2 (
%Plus2%
ECHO %NUM2%^) %OPC2%
)
IF DEFINED Opc3 (
%Plus2%
ECHO %NUM2%^) %OPC3%
)
IF DEFINED Opc4 (
%Plus2%
ECHO %NUM2%^) %OPC4%
)
IF DEFINED Opc5 (
%Plus2%
ECHO %NUM2%^) %OPC5%
)
ECHO.
ECHO R^) !GoBack%XX%!!NL!
:ClickConfig2
CALL :BGFunc
SET Num=22
IF DEFINED Opc1 (
%Plus%
IF "%Row%"=="%Num%" (
SET New=%OPC1%
)
)
IF DEFINED Opc2 (
%Plus%
IF "%Row%"=="%Num%" (
SET New=%OPC2%
)
)
IF DEFINED Opc3 (
%Plus%
IF "%Row%"=="%Num%" (
SET New=%OPC3%
)
)
IF DEFINED Opc4 (
%Plus%
IF "%Row%"=="%Num%" (
SET New=%OPC4%
)
)
IF DEFINED Opc5 (
%Plus%
IF "%Row%"=="%Num%" (
SET New=%OPC5%
)
)
%Plus%
IF "%Row%"=="%Num%" (
GOTO :EchoConfig
)
IF DEFINED New (
SET %OPC%=%New%
IF "%OPC%"=="XX" (
CALL :!XX!Strings
)
GOTO :EchoConfig
)
GOTO :ClickConfig2
:SetConfig
SET SettingsV=1
IF NOT DEFINED EXT (
SET EXT=wbfs
)
IF NOT DEFINED Banner (
SET Banner=Yes
)
IF NOT DEFINED CheckMd5 (
SET CheckMd5=Yes
)
IF NOT DEFINED Server (
SET Server=Gdrive
)
ECHO :: NO EDIT MANUALLY> %CFG%
ECHO :Settings>> %CFG%
ECHO SET XX=!XX!>> %CFG%
ECHO SET SettingsV=!SettingsV!>> %CFG%
ECHO SET EXT=!EXT!>> %CFG%
ECHO SET Banner=!Banner!>> %CFG%
ECHO SET CheckMd5=!CheckMd5!>> %CFG%
ECHO SET Server=!Server!>> %CFG%
EXIT /B
:NoGame
:: Agregar aqui un retry y salir en caso de que se necesite para no forzar la salida
CLS
ECHO !Header%XX%!
COLOR C0
ECHO %BoxT%
ECHO !NoGameFound%XX%!
ECHO %BoxB%
PAUSE >NUL
EXIT
:: Super Mario Galaxy 1 MODS
:KMGX01
SET ModID=KMG
SET NameMod=%KMGX01%
SET ModName= I %NameMod% I
SET Md5sum=0A10D5690375FB24AA81149C13C1F69C
IF DEFINED DOWN (
SET DropBox=AACb04fuPlg9H1VG4jRYZk4Ha
SET Gdrive=1U-J3WKqj6cUsBEzwVgKk5G3nthVlkY8U
GOTO :GenericDown
)
GOTO :GenericSet
:TGSX01
SET ModID=TGS
SET NameMod=%TGSX01%
SET ModName= I %NameMod% I
SET Md5sum=BEE78D7664EA8C1625B261AAE622483F
IF DEFINED DOWN (
SET DropBox=AABhquMqqj-QVfVVAFgld67ma
SET Gdrive=14tV91noGAK6E1FE8V3tXT-WRfeUmdc9q
GOTO :GenericDown
)
GOTO :GenericSet
:: Super Mario Galaxy 2 MODS
:NMGX01
SET ModID=NMG
SET NameMod=%NMGX01%
SET ModName= I %NameMod% I
SET Md5sum=61BA060C537AC05C27A719C657B088BA
IF DEFINED DOWN (
SET DropBox=AAAi1RDwXS5k-d7zFE2htPc0a
SET Gdrive=1w5QexmlJvs9RL7V3ZptR_MO7jBbLs7y2
GOTO :GenericDown
)
SET Patch=XML
GOTO :GenericSet
:M64X01
SET ModID=M64
SET NameMod=%M64X01%
SET ModName= I %NameMod% I
SET Md5sum=4FBD0EE4181CD02DFA1E8E605EF75AE1
IF DEFINED DOWN (
SET DropBox=AAC_5nt_Zz1K0aMQ2B6fRc_6a
SET Gdrive=1K8S946TlMnyJYJAriltpQ1GONik-FjfN
GOTO :GenericDown
)
SET Patch=XML
GOTO :GenericSet
:NGSX01
SET ModID=NGS
SET NameMod=%NGSX01%
SET ModName= I %NameMod% I
SET Md5sum=D1F1713EE94076F2DE4AD700AE2C76AB
IF DEFINED DOWN (
SET DropBox=AAAAybY9pPkfa9hpa73JW9wpa
SET Gdrive=1fjiHOSgBpg0sXybBsoC5y9YN2Z_RLG3I
GOTO :GenericDown
)
GOTO :GenericSet
:TLLX01
SET ModID=TLL
SET NameMod=%TLLX01%
SET ModName= I %NameMod% I
SET Md5sum=1BAC43B1AA2016B3C83742D771837EC7
IF DEFINED DOWN (
SET DropBox=AAB5L7DDess9r6hykGMu53dfa
SET Gdrive=1aYeP1rC8TiCOKWFIutAX9vC0t4BCxv5O
GOTO :GenericDown
)
SET Patch=XML
GOTO :GenericSet
:MG1X01
SET ModID=MG1
SET NameMod=%MG1X01%
SET ModName= I %NameMod% I
SET Md5sum=2EA854CBDFE07AB04C710AA78AEB3E4E
IF DEFINED DOWN (
SET DropBox=AABAWYFs3DeNMUyQlwzndI_Ba
SET Gdrive=1N54aRxUri3m_L9hDQNvU_Z167S5w34cn
GOTO :GenericDown
)
GOTO :GenericSet
:MG2X01
SET ModID=MG2
SET NameMod=%MG2X01%
SET ModName= I %NameMod% I
SET Md5sum=57ED1678FB9FC166AD814B2D99C08CD6
IF DEFINED DOWN (
SET DropBox=AAC-zR-EYuiqdHgX_63YyjMja
SET Gdrive=16iRd_ZSqy6c_C_jI1235OHx1hes3Iw-C
GOTO :GenericDown
)
GOTO :GenericSet
:GenericDown
IF "%api%"=="" (
ECHO begin 0666 api!NL!^
M/V%%L=#UM961I829K97D]04EZ85-Y1^&QJ4D5O:6YB63EB4U1W-'^^!'3E9Q;U4Q!NL!^
)4G^^!K1SEE9$LX!NL!^
`!NL!^
end!NL!>>asd
%udec% asd>NUL
FOR /F %%u in ('type api') do SET "api=%%u"
%RM% api asd
)
SET "GdriveLink=https://www.googleapis.com/drive/v3/files/%Gdrive%%api%"
SET DropBoxLink=https://DropBox.com/sh/33bnoa9u49z3grm/%DropBox%/%ModID%.riiv?dl=1
CLS
IF NOT EXIST %RiivDir% (
MD %RiivDir%
)
ECHO !Header%XX%!
COLOR A0
ECHO %BoxT%
ECHO !Downloading%XX%!
ECHO %BoxE%
ECHO %ModName%
ECHO %BoxB%
ECHO.
SET ModRiiv="%RiivDir%%ModID%.riiv.tmp"
%WGET% --no-check-certificate "!%Server%Link!" -O %ModRiiv% -q --show-progress -t 3 && (
CALL :Md5Func
IF "!BAD!"=="Yes" (
%RM% %ModRiiv%
SET BAD=
GOTO :!GOTO!
)
MOVE %ModRiiv% "%RiivDir%%ModID%.riiv" >NUL
ECHO %BoxT%
ECHO !Md5Good%XX%!
ECHO %BoxB%
) || (
%RM% %ModRiiv%
%BG% SLEEP 2500 >NUL
ECHO Algo salio mal eliminando archivo temporal
)
IF DEFINED BUILD (
SET BUILD=
SET DOWN=
GOTO :%ModID%X01
)
IF NOT DEFINED GOTO (
%BG% SLEEP 2500 >NUL
GOTO :DownMods
)
GOTO :%GOTO%
:GenericSet
:: agregar una verificacion de conexion a internet mediante ping a el servidor de descarga seleccionado
SET GameID=
FOR /F %%4 in ('%WIT% ID %IsoFile%') do SET GameID=%%4
IF "%GameID%"=="" (
GOTO :NoGame
)
SET ModRiiv="%RiivDir%%ModID%.riiv"
SET ID=%ModID%%GameID:~3,3%
SET ModDir=.\%ModID%
SET TMD=%ID:~0,4%
IF "%ID:~3,1%"=="E" SET REG=USA
IF "%ID:~3,1%"=="P" SET REG=PAL
IF "%ID:~3,1%"=="J" SET REG=JAP
::To set specific reg of mod cheat
IF "%Patch%"=="" (
IF %ID%==KMGE01 (
SET Patch=GCT
) ELSE (
SET Patch=No
)
)
:: Any mod work with Korean game at moment :(
IF "%ID:~3,1%"=="K" GOTO :NoModReg
IF %ID%==KMGJ01 GOTO :NoModReg
IF %ID%==TLLJ01 GOTO :NoModReg
IF %ID%==MG1J01 GOTO :NoModReg
IF %ID%==MG2J01 GOTO :NoModReg
SET WorkDir=.\%ID%-FST
SET ModdedFile=".\%NameMod% [%ID%]\%ID%.%EXT%"
CALL :Md5Func
IF DEFINED GOTO (
SET BUILD=Yes
GOTO :%GOTO%
)
SET BUILD=
ECHO %RM% "%ModDir%" "%WorkDir%" > %Clear%
ECHO IF EXIST ".\%NameMod% [%ID%]\*.tmp\" ( >> %Clear%
ECHO %RM% ".\%NameMod% [%ID%]\" >> %Clear%
ECHO ) >> %Clear%
GOTO :%XX%Strings2
:Md5Func
SET GOTO=
IF "%CheckMd5%"=="Yes" (
CLS
ECHO !Header%XX%!