-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMSAS.bat
83 lines (81 loc) · 10.3 KB
/
MSAS.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
@echo off
echo ---Minecraft Server Automatic Setup by GamingMIDI---
if not exist "Launcher.bat" (
del LauncherConfig.ini
) else (
echo Server has already been set up!
pause >nul
exit
)
cls
echo ---Minecraft Server Automatic Setup by GamingMIDI---
echo [Main]>LauncherConfig.ini
set /p "Name=Server Name: "
if "%Name%"=="" (
echo Name was null, using default
echo ServerName=Minecraft Server>>LauncherConfig.ini
) else (
echo ServerName=%Name% >>LauncherConfig.ini
)
:SetRam
echo.
echo How much RAM do you want the server to use? (Recommended 4G), Examples: "6G" (6 GB), "5999K" (5,999 KB)
set /p "RAM=RAM: "
IF "%RAM%"=="" (
echo RAM was null, using 4G
echo RAM=4G>>LauncherConfig.ini
) else (
echo RAM=%RAM%>>LauncherConfig.ini
)
:PaperQuestion
echo.
set /p "Paper=Paper server? [Y,N]: "
if "%Paper%"=="" (
echo Answer the question with either Y or N
goto PaperQuestion
) else if "%paper%"=="y" (
echo Jar="paper-136.jar">>LauncherConfig.ini
set Jar="paper-136.jar"
echo.
echo Downloading paper jar... This could take several minutes.
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://papermc.io/api/v1/paper/1.16.1/136/download', 'paper-136.jar')"
echo Done.
echo.
goto startsetup
) else if "%paper%"=="n" (
goto SetJar
)
echo Invalid answer (Answer is case sensitive)!
goto PaperQuestion
:SetJar
set /p "Jar=Name of the jar you're using: "
if "%Jar%"=="" (
echo -Jar name cannot be null!
echo.
goto SetJar
)
set Jar=%Jar%.jar
if not exist "%Jar%" (
echo -%Jar% does not exist!
echo.
goto SetJar
)
echo Jar=%Jar%>>LauncherConfig.ini
:startsetup
java -Xms512M -Xmx%RAM% -jar "%Jar%"
echo By continuing, you agree to Mojang's EULA (https://account.mojang.com/documents/minecraft_eula).
echo Press any key if you accept!
pause >nul
echo Updating eula.txt
powershell -Command "(gc eula.txt) -replace 'false', 'true' | Out-File -encoding ASCII eula.txt"
echo 40 65 63 68 6F 20 6F 66 66 0D 0A 73 65 74 6C 6F 63 61 6C 20 45 6E 61 62 6C 65 44 65 6C 61 79 65 64 45 78 70 61 6E 73 69 6F 6E 0D 0A 46 4F 52 20 2F 46 20 22 74 6F 6B 65 6E 73 3D 2A 20 55 53 45 42 41 43 4B 51 22 20 25 25 46 20 49 4E 20 28 60 69 6E 69 20 2F 73 20 4D 61 69 6E 20 2F 69 20 53 65 72 76 65 72 4E 61 6D 65 20 4C 61 75 6E 63 68 65 72 43 6F 6E 66 69 67 2E 69 6E 69 60 29 20 44 4F 20 28 0D 0A 53 45 54 20 53 65 72 76 65 72 4E 61 6D 65 3D 25 25 46 0D 0A 29 0D 0A 0D 0A 74 69 74 6C 65 20 25 53 65 72 76 65 72 4E 61 6D 65 25 0D 0A 0D 0A 46 4F 52 20 2F 46 20 22 74 6F 6B 65 6E 73 3D 2A 20 55 53 45 42 41 43 4B 51 22 20 25 25 46 20 49 4E 20 28 60 69 6E 69 20 2F 73 20 4D 61 69 6E 20 2F 69 20 4A 61 72 20 4C 61 75 6E 63 68 65 72 43 6F 6E 66 69 67 2E 69 6E 69 60 29 20 44 4F 20 28 0D 0A 0D 0A 53 45 54 20 4A 61 72 3D 25 25 46 0D 0A 29 0D 0A 0D 0A 46 4F 52 20 2F 46 20 22 74 6F 6B 65 6E 73 3D 2A 20 55 53 45 42 41 43 4B 51 22 20 25 25 46 20 49 4E 20 28 60 69 6E 69 20 2F 73 20 4D 61 69 6E 20 2F 69 20 52 41 4D 20 4C 61 75 6E 63 68 65 72 43 6F 6E 66 69 67 2E 69 6E 69 60 29 20 44 4F 20 28 0D 0A 0D 0A 53 45 54 20 52 41 4D 3D 25 25 46 0D 0A 29 0D 0A 0D 0A 66 6F 72 20 2F 66 20 22 73 6B 69 70 3D 31 22 20 25 25 70 20 69 6E 20 28 27 77 6D 69 63 20 6F 73 20 67 65 74 20 66 72 65 65 70 68 79 73 69 63 61 6C 6D 65 6D 6F 72 79 27 29 20 64 6F 20 28 20 0D 0A 20 20 73 65 74 20 6D 3D 25 25 70 0D 0A 20 20 67 6F 74 6F 20 3A 64 6F 6E 65 0D 0A 29 0D 0A 3A 64 6F 6E 65 0D 0A 63 6C 73 0D 0A 65 63 68 6F 2E 0D 0A 65 63 68 6F 20 43 75 72 72 65 6E 74 20 41 76 61 69 6C 61 62 6C 65 20 4D 65 6D 6F 72 79 3A 20 25 6D 25 20 42 79 74 65 73 0D 0A 65 63 68 6F 2E 0D 0A 65 63 68 6F 20 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 0D 0A 65 63 68 6F 2E 0D 0A 65 63 68 6F 20 53 74 61 72 74 69 6E 67 2E 2E 2E 0D 0A 65 63 68 6F 2E 0D 0A 3A 6D 61 69 6E 0D 0A 65 63 68 6F 20 53 74 61 72 74 69 6E 67 20 25 4A 61 72 25 20 77 69 74 68 20 25 52 41 4D 25 20 6F 66 20 52 41 4D 0D 0A 6A 61 76 61 20 2D 58 6D 73 35 31 32 4D 20 2D 58 6D 78 25 52 41 4D 25 20 2D 6A 61 72 20 22 25 4A 61 72 25 22 20 6E 6F 67 75 69 0D 0A 69 66 20 25 65 72 72 6F 72 6C 65 76 65 6C 25 20 6E 65 71 20 30 20 67 6F 74 6F 20 65 72 72 6F 72 20 25 65 72 72 6F 72 6C 65 76 65 6C 25 0D 0A 65 63 68 6F 20 54 68 65 20 53 65 72 76 65 72 20 43 72 61 73 68 65 64 21 21 20 52 65 73 74 61 72 74 69 6E 67 2E 2E 2E 0D 0A 67 6F 74 6F 20 6D 61 69 6E 0D 0A >ltemp
echo Unpacking Launcher.bat...
certutil -f -decodehex ltemp Launcher.bat >nul
del ltemp
echo 3A3A202D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D0D0A3A3A20696E692E6261740D0A3A3A20696E692E626174202F3F20666F722075736167650D0A3A3A202D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D0D0A0D0A406563686F206F66660D0A7365746C6F63616C20656E61626C6564656C61796564657870616E73696F6E0D0A0D0A676F746F20626567696E0D0A0D0A3A75736167650D0A6563686F2055736167653A20257E6E7830202F69206974656D205B2F762076616C75655D205B2F732073656374696F6E5D20696E6966696C650D0A6563686F3B0D0A6563686F2054616B652074686520666F6C6C6F77696E6720696E692066696C6520666F72206578616D706C653A0D0A6563686F3B0D0A6563686F202020205B436F6E6669675D0D0A6563686F2020202070617373776F72643D313233340D0A6563686F202020207573657274726965733D300D0A6563686F20202020616C6C6F777465726D696E6174653D300D0A6563686F3B0D0A6563686F20546F207265616420746865202270617373776F7264222076616C75653A0D0A6563686F20202020257E6E7830202F7320436F6E666967202F692070617373776F726420696E6966696C650D0A6563686F3B0D0A6563686F20546F206368616E6765207468652022757365727472696573222076616C756520746F20353A0D0A6563686F20202020257E6E7830202F7320436F6E666967202F6920757365727472696573202F76203520696E6966696C650D0A6563686F3B0D0A6563686F20496E207468652061626F7665206578616D706C65732C20222F7320436F6E66696722206973206F7074696F6E616C2C206275742077696C6C20616C6C6F77207468652073656C656374696F6E206F660D0A6563686F2061207370656369666963206974656D2077686572652074686520696E692066696C6520636F6E7461696E732073696D696C6172206974656D7320696E206D756C7469706C652073656374696F6E732E0D0A676F746F203A454F460D0A0D0A3A626567696E0D0A69662022257E31223D3D222220676F746F2075736167650D0A666F722025254920696E20286974656D2076616C75652073656374696F6E20666F756E642920646F20736574202525493D0D0A666F722025254920696E2028252A2920646F20280D0A20202020696620646566696E6564206E65787420280D0A2020202020202020696620216E657874213D3D2F6920736574206974656D3D2525490D0A2020202020202020696620216E657874213D3D2F76207365742076616C75653D2525490D0A2020202020202020696620216E657874213D3D2F73207365742073656374696F6E3D2525490D0A2020202020202020736574206E6578743D0D0A202020202920656C736520280D0A2020202020202020666F722025257820696E20282F69202F76202F732920646F206966202225257E49223D3D22252578222073657420226E6578743D25257E49220D0A20202020202020206966206E6F7420646566696E6564206E65787420280D0A20202020202020202020202073657420226172673D25257E49220D0A20202020202020202020202069662022216172673A7E302C3121223D3D222F2220280D0A20202020202020202020202020202020313E2632206563686F204572726F723A20556E7265636F676E697A6564206F7074696F6E202225257E49220D0A20202020202020202020202020202020313E2632206563686F3B0D0A20202020202020202020202020202020313E26322063616C6C203A75736167650D0A2020202020202020202020202020202065786974202F6220310D0A2020202020202020202020202920656C7365207365742022696E6966696C653D25257E49220D0A2020202020202020290D0A20202020290D0A290D0A666F722025254920696E20286974656D20696E6966696C652920646F206966206E6F7420646566696E65642025254920676F746F2075736167650D0A6966206E6F74206578697374202225696E6966696C65252220280D0A20202020313E2632206563686F204572726F723A2025696E6966696C6525206E6F7420666F756E642E0D0A2020202065786974202F6220310D0A290D0A0D0A6966206E6F7420646566696E65642073656374696F6E20280D0A202020206966206E6F7420646566696E65642076616C756520280D0A2020202020202020666F72202F6620227573656261636B7120746F6B656E733D322064656C696D733D3D222025254920696E20286066696E64737472202F6920225E256974656D255C3D22202225696E6966696C652522602920646F20280D0A2020202020202020202020206563686F282525490D0A2020202020202020290D0A202020202920656C736520280D0A2020202020202020666F72202F6620227573656261636B712064656C696D733D222025254920696E20286066696E64737472202F6E20225E22202225696E6966696C652522602920646F20280D0A20202020202020202020202073657420226C696E653D252549222026262073657420226C696E653D216C696E653A2A3A3D21220D0A2020202020202020202020206563686F28216C696E6521207C2066696E64737472202F6920225E256974656D255C3D22203E4E554C20262620280D0A20202020202020202020202020202020313E3E2225696E6966696C65252E3122206563686F28256974656D253D2576616C7565250D0A202020202020202020202020202020206563686F282576616C7565250D0A20202020202020202020202029207C7C20313E3E2225696E6966696C65252E3122206563686F28216C696E65210D0A2020202020202020290D0A20202020290D0A2920656C736520280D0A20202020666F72202F6620227573656261636B712064656C696D733D222025254920696E20286066696E64737472202F6E20225E22202225696E6966696C652522602920646F20280D0A202020202020202073657420226C696E653D252549222026262073657420226C696E653D216C696E653A2A3A3D21220D0A2020202020202020696620646566696E656420666F756E6420280D0A202020202020202020202020696620646566696E65642076616C756520280D0A202020202020202020202020202020206563686F28216C696E6521207C2066696E64737472202F6920225E256974656D255C3D22203E4E554C20262620280D0A2020202020202020202020202020202020202020313E3E2225696E6966696C65252E3122206563686F28256974656D253D2576616C7565250D0A20202020202020202020202020202020202020206563686F282576616C7565250D0A202020202020202020202020202020202020202073657420666F756E643D0D0A2020202020202020202020202020202029207C7C20313E3E2225696E6966696C65252E3122206563686F28216C696E65210D0A2020202020202020202020202920656C7365206563686F28216C696E6521207C2066696E64737472202F6920225E256974656D255C3D22203E4E554C20262620280D0A20202020202020202020202020202020666F72202F662022746F6B656E733D322064656C696D733D3D222025257820696E202822216C696E6521222920646F20280D0A20202020202020202020202020202020202020206563686F282525780D0A202020202020202020202020202020202020202065786974202F6220300D0A20202020202020202020202020202020290D0A202020202020202020202020290D0A20202020202020202920656C736520280D0A202020202020202020202020696620646566696E65642076616C75652028313E3E2225696E6966696C65252E3122206563686F28216C696E6521290D0A2020202020202020202020206563686F28216C696E6521207C2066696E64202F6920225B2573656374696F6E255D22203E4E554C2026262073657420666F756E643D310D0A2020202020202020290D0A20202020290D0A290D0A0D0A6966206578697374202225696E6966696C65252E3122206D6F7665202F79202225696E6966696C65252E3122202225696E6966696C6525223E4E554C >temp
echo Unpacking ini.bat...
certutil -f -decodehex temp ini.bat >nul
del temp
cls
echo Done with MSAS
Launcher.bat