Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cd "%~dp0"
- SET unsmod="%CD%\unsmod.log"
- echo %CD% 1> %unsmod% 2>&1
- IF NOT DEFINED unluac (
- IF EXIST "%CD%\unluac.jar" (
- SET unluac="%CD%\unluac.jar"
- ) ELSE (
- echo ERROR: Unluac not found 1>> %unsmod% 2>&1
- pause
- EXIT /b
- )
- )
- echo 1 1>> %unsmod% 2>&1
- IF NOT DEFINED stonehearth (
- IF EXIST "%CD%\Stonehearth.exe" (
- SET stonehearth="%CD%"
- ) ELSE (IF EXIST "..\Stonehearth.exe" (
- cd ..
- SET stonehearth="%CD%"
- ) ELSE (IF EXIST "C:\Program Files (x86)\Steam\SteamApps\common\Stonehearth" (
- SET stonehearth="C:\Program Files (x86)\Steam\SteamApps\common\Stonehearth"
- ) ELSE (IF EXIST "C:\Program Files\Steam\SteamApps\common\Stonehearth" (
- SET stonehearth="C:\Program Files\Steam\SteamApps\common\Stonehearth"
- ) ELSE (IF EXIST "C:\Program Files (x86)\Stonehearth" (
- SET stonehearth="C:\Program Files (x86)\Stonehearth"
- ) ELSE (IF EXIST "C:\Program Files\Stonehearth" (
- SET stonehearth="C:\Program Files\Stonehearth"
- ) ELSE (
- SET stonehearth="NOTFOUND"
- )
- ))))))
- echo %stonehearth% 1>> %unsmod% 2>&1
- IF %stonehearth%=="NOTFOUND" (
- echo ERROR: Stonehearth install not found 1>> %unsmod% 2>&1
- pause
- EXIT /b
- ) ELSE (
- echo 3 1>> %unsmod% 2>&1
- cd "%stonehearth:~1,-1%\mods" 1>> %unsmod% 2>&1
- echo 4 1>> %unsmod% 2>&1
- pause
- FOR %%i IN (*.smod) DO (
- IF EXIST "%%~ni\nul" (
- RMDIR /q /s "%%~ni" 1>> %unsmod% 2>&1
- )
- echo %%i 1>> %unsmod% 2>&1
- jar xf "%%i" 1>> %unsmod% 2>&1
- cd "%%~ni"
- FOR /R %%j IN (*.luac) DO (
- java -jar %unluac% "%%j" > "%%j_lua"
- del "%%j" 1>> %unsmod% 2>&1
- rename "%%j_lua" *.lua 1>> %unsmod% 2>&1
- )
- cd .. 1>> %unsmod% 2>&1
- REM del "%%i" 1>> %unsmod% 2>&1
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement