Advertisement
Xavion

UnSmod

Jan 2nd, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cd "%~dp0"
  2. SET unsmod="%CD%\unsmod.log"
  3. echo %CD% 1> %unsmod% 2>&1
  4. IF NOT DEFINED unluac (
  5.     IF EXIST "%CD%\unluac.jar" (
  6.         SET unluac="%CD%\unluac.jar"
  7.     ) ELSE (
  8.         echo ERROR: Unluac not found 1>> %unsmod% 2>&1
  9.         pause
  10.         EXIT /b
  11.     )
  12. )
  13. echo 1 1>> %unsmod% 2>&1
  14.  
  15. IF NOT DEFINED stonehearth (
  16.     IF EXIST "%CD%\Stonehearth.exe" (
  17.         SET stonehearth="%CD%"
  18.     ) ELSE (IF EXIST "..\Stonehearth.exe" (
  19.         cd ..
  20.         SET stonehearth="%CD%"
  21.     ) ELSE (IF EXIST "C:\Program Files (x86)\Steam\SteamApps\common\Stonehearth" (
  22.         SET stonehearth="C:\Program Files (x86)\Steam\SteamApps\common\Stonehearth"
  23.     ) ELSE (IF EXIST "C:\Program Files\Steam\SteamApps\common\Stonehearth" (
  24.         SET stonehearth="C:\Program Files\Steam\SteamApps\common\Stonehearth"
  25.     ) ELSE (IF EXIST "C:\Program Files (x86)\Stonehearth" (
  26.         SET stonehearth="C:\Program Files (x86)\Stonehearth"
  27.     ) ELSE (IF EXIST "C:\Program Files\Stonehearth" (
  28.         SET stonehearth="C:\Program Files\Stonehearth"
  29.     ) ELSE (
  30.         SET stonehearth="NOTFOUND"
  31.     )
  32. ))))))
  33. echo %stonehearth% 1>> %unsmod% 2>&1
  34.  
  35. IF %stonehearth%=="NOTFOUND" (
  36.     echo ERROR: Stonehearth install not found 1>> %unsmod% 2>&1
  37.     pause
  38.     EXIT /b
  39. ) ELSE (
  40.     echo 3 1>> %unsmod% 2>&1
  41.     cd "%stonehearth:~1,-1%\mods" 1>> %unsmod% 2>&1
  42.     echo 4 1>> %unsmod% 2>&1
  43.     pause
  44.     FOR %%i IN (*.smod) DO (
  45.         IF EXIST "%%~ni\nul" (
  46.             RMDIR /q /s "%%~ni" 1>> %unsmod% 2>&1
  47.         )
  48.         echo %%i 1>> %unsmod% 2>&1
  49.         jar xf "%%i" 1>> %unsmod% 2>&1
  50.         cd "%%~ni"
  51.         FOR /R %%j IN (*.luac) DO (
  52.             java -jar %unluac% "%%j" > "%%j_lua"
  53.             del "%%j" 1>> %unsmod% 2>&1
  54.             rename "%%j_lua" *.lua 1>> %unsmod% 2>&1
  55.         )
  56.         cd .. 1>> %unsmod% 2>&1
  57.         REM del "%%i" 1>> %unsmod% 2>&1
  58.     )
  59. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement