After all instructions you may drag'n'drop the folder into the new file, and all folders inside the folder shall be compiled as well.
Create a new file named "folder_compiler.bat", then edit it and put this code in:
Code:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
if [%1]==[] goto nofolder
set MyPath="%CD%"
cd !MyPath!
:loop
For /R %1 %%G IN (*.sp) do (
spcomp %%G
set RelativePath=%%~dG%%~pG
call:ReplaceText "!RelativePath!" !MyPath! "" RESULT
Set RESULT=!RESULT:~1!
Set RESULT=!RESULT:~0,-1!
set RelativePath=!RESULT!
REM Remove quotes.
set MyPath=!MyPath:"=!
IF not exist !MyPath!\compiled\!RelativePath! md !MyPath!\compiled\!RelativePath!
move !MyPath!\%%~nG.smx !MyPath!\compiled\!RelativePath!
)
shift
if not [%1]==[] goto loop
Echo finish.
pause
goto eof
:nofolder
Echo No folder was fed to the batch file.
pause
:FUNCTIONS
@REM FUNCTIONS AREA
GOTO:EOF
EXIT /B
:ReplaceText
::Replace Text In String
::USE:
:: CALL:ReplaceText "!OrginalText!" OldWordToReplace NewWordToUse Result
::Example
::SET "MYTEXT=jump over the chair"
:: echo !MYTEXT!
:: call:ReplaceText "!MYTEXT!" chair table RESULT
:: echo !RESULT!
::
:: Remember to use the "! on the input text, but NOT on the Output text.
:: The Following is Wrong: "!MYTEXT!" !chair! !table! !RESULT!
:: ^^Because it has a ! around the chair table and RESULT
:: Remember to add quotes "" around the MYTEXT Variable when calling.
:: If you don't add quotes, it won't treat it as a single string
::
set "OrginalText=%~1"
set "OldWord=%~2"
set "NewWord=%~3"
call set OrginalText=%%OrginalText:!OldWord!=!NewWord!%%
SET %4=!OrginalText!
GOTO:EOF
__________________
I am available to make plugins for pay.
Discord: Eyal282#1334