Raised This Month: $12 Target: $400
 3% 

[TUT] Compiling AMXX plugins with Sublime Text


Post New Thread Reply   
 
Thread Tools Display Modes
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-27-2018 , 14:29   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #111

Fixed. Just need to restart Sublime Text and the package will be updated in a few minutes/seconds.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 07-27-2018 at 14:52.
addons_zz is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-27-2018 , 15:06   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #112

Thanks and good job, looks all fine now. More two little observations:

1° Autocomplete doesn't "catch" stock const defined in include files.

Code:
stock const STOCK_TEST[] = "something";

2° If you write the fully name of a native, forward or whatever and the name be party of another, when you click to open it in include, looks like it searchs for the first match and not the exactly match. You can test that with get_players, since in amxmodx.inc is there a get_playersnum.
__________________









Last edited by CrazY.; 07-27-2018 at 15:06.
CrazY. is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-27-2018 , 17:51   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #113

Fixed. In a few hours package control should update your package.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-30-2018 , 08:48   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #114

Thanks for fixing the bugs. Now, about the multiple compilers, I tried following all the edits you mentioned on the previous pages, but after the update I believe that the compile script itself is a little different and some of the lines I need to edit are not there.

Here's how I made my .sublime-build file:

PHP Code:
{
    
"working_dir""$file_path",
    
"cmd": ["$packages/User/Amxmodx/Dust2Respawn.bat","$file""$file_base_name""$packages""$file_path"],

    
// "target": "ansi_color_build",
    
"syntax""Packages/AmxxEditor/AmxxEditorConsole.sublime-syntax",

    
"variants":
    [
        {
            
"name""Dust2Respawn.bat",
            
"cmd": ["$packages/User/Amxmodx/Dust2Respawn.bat","$file""$file_base_name""$packages""$file_path"],
        },
        {
            
"name""Deathrun.bat",
            
"cmd": ["$packages/User/Amxmodx/Deathrun.bat","$file""$file_base_name""$packages""$file_path"],
        },
        {
            
"name""JailBreak.bat",
            
"cmd": ["$packages/User/Amxmodx/JailBreak.bat","$file""$file_base_name""$packages""$file_path"],
        },
        {
            
"name""Furien.bat",
            
"cmd": ["$packages/User/Amxmodx/Furien.bat","$file""$file_base_name""$packages""$file_path"],
        },
        {
            
"name""ReHLDS.bat",
            
"cmd": ["$packages/User/Amxmodx/ReHLDS.bat","$file""$file_base_name""$packages""$file_path"],
        },
    ],

    
"selector""source.AmxxPawn, source.AMXX, source.sma",
    
"file_regex""^.*[\\/\\\\]+(.+)\\(([0-9]+ ?.*)\\) : (.*)",

And here's one of the compilers (Dust2Respawn183.bat):

PHP Code:

@echo off

:: AMXX Plugin Compiler Script
::
::  
This program is free softwareyou can redistribute it and/or modify it
::  under the terms of the GNU General Public License as published by the
::  Free Software Foundationeither version 2 of the License, or ( at
::  your option any later version.
::
::  
This program is distributed in the hope that it will be usefulbut
::  WITHOUT ANY WARRANTYwithout even the implied warranty of
::  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
::  
See the GNU General Public License for more details.
::
::  
You should have received a copy of the GNU General Public License
::  along with this program.  If notsee <http://www.gnu.org/licenses/>.
::


:: 
Get the current date to the variable CURRENT_DATE
for /%%i in ('date /T') do set CURRENT_DATE=%%i

:: The format of %TIMEis HH:MM:SS,CS for example 23:59:59,99
echo.
echo 
Compiling %2... Current time is: %TIME% - %CURRENT_DATE%
echo.

:: 
Put here the paths to the folders where do you want to install the plugin.
:: 
You must to provide at least one folder.
set "folders_list[0]=E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\plugins"

:: Where is your compiler?
::
:: 
Example:
:: 
F:\SteamCMD\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\amxxpc.exe
::
set "AMXX_COMPILER_PATH=E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\amxxpc.exe"





::
:: 
Setup the time calculation script
::
:: 
Time calculation downloaded from:
:: 
http://stackoverflow.com/questions/9922498/calculate-time-difference-in-windows-batch-file
::
:: 
AMX Mod X compiling batch downloaded from:
:: 
https://github.com/alliedmodders/amxmodx/pull/212/commits

:: Here begins the command you want to measure
for /"tokens=1-4 delims=:.," %%a in ("%time%") do (
   
set /"start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)


::
:: 
Setup the batch variables
:: Example: $1=F:\SteamCMD\steamapps\common\Half-Life\czero\addons\my_plugin.sma
::
:: $
1 is the first shell argument and $2 is the second shell argument passed by AmxxEditor.sublime-build
:: Usually they should be the plugin's file full path and the plugin's file name without extension.
::
:: 
Removing double quotes from variables in batch file creates problems with CMD environment
:: https://stackoverflow.com/questions/1964192/removing-double-quotes-from-variables-in-batch-file-creates-problems-with-cmd-en
set "PLUGIN_SOURCE_CODE_FILE_PATH=%1"
set "PLUGIN_SOURCE_CODE_FILE_PATH=%PLUGIN_SOURCE_CODE_FILE_PATH:"=%"

:: $4 is the path of the folder where the plugin source code is.
:: Example F:\SteamCMD\steamapps\common\Half-Life\czero\addons\
set "
SOURCE_CODE_FOLDER=%4"
set "
SOURCE_CODE_FOLDER=%SOURCE_CODE_FOLDER:"=%"
set "SOURCE_CODE_INCLUDE_FOLDER=%SOURCE_CODE_FOLDER%\include"

:: Example: $2="my_plugin"
set "PLUGIN_BASE_FILE_NAME=%2"
set "PLUGIN_BASE_FILE_NAME=%PLUGIN_BASE_FILE_NAME:"=%"
set "
PLUGIN_BINARY_FILE_PATH=%folders_list[0]%\%PLUGIN_BASE_FILE_NAME%.amxx"

:: Set a path variable with spaces in the path in a Windows .cmd file or batch file
:: https://stackoverflow.com/questions/1851012/set-a-path-variable-with-spaces-in-the-path-in-a-windows-cmd-file-or-batch-file
IF "
%PLUGIN_BASE_FILE_NAME%"=="" echo You must to save the plugin before to compile it. & goto end



::
:: Compile the AMXX plugin
:compile_the_plugin

:: Build the compiler include folder path
setlocal enabledelayedexpansion enableextensions

:: See: http://stackoverflow.com/questions/659647/how-to-get-folder-path-from-file-path-with-cmd
:: set AMXX_COMPILER_PATH=C:\Somewhere\Somewhere\SomeFile.txt
call :path_from_file_name AMXX_COMPILER_FOLDER !AMXX_COMPILER_PATH!

:: Batch script make setlocal variable accessed by other batch files
:: https://stackoverflow.com/questions/15494688/batch-script-make-setlocal-variable-accessed-by-other-batch-files
endlocal & (
  set "
AMXX_COMPILER_FOLDER=%AMXX_COMPILER_FOLDER%"
)

:: Build the compiler include folder path
set "
COMPILER_INCLUDE_FOLDER_PATH=%AMXX_COMPILER_FOLDER%include"

:: Delete the old binary in case some crazy problem on the compiler, or in the system while copy it.
:: So, this way there is not way you are going to use the wrong version of the plugin without knowing it.
IF EXIST "
%PLUGIN_BINARY_FILE_PATH%" del "%PLUGIN_BINARY_FILE_PATH%"

:: To call the compiler to compile the plugin to the output folder 
$PLUGIN_BINARY_FILE_PATH
:: Comment the following line and uncomment the next line to it, if you not want to override your compiler files
"
%AMXX_COMPILER_PATH%" -i"%SOURCE_CODE_INCLUDE_FOLDER%" -o"%PLUGIN_BINARY_FILE_PATH%" "%PLUGIN_SOURCE_CODE_FILE_PATH%"
:: "
%AMXX_COMPILER_PATH%" -i"%COMPILER_INCLUDE_FOLDER_PATH%" -i"%SOURCE_CODE_INCLUDE_FOLDER%" -o"%PLUGIN_BINARY_FILE_PATH%" "%PLUGIN_SOURCE_CODE_FILE_PATH%"

:: If there was a compilation error, there is nothing more to be done.
IF NOT EXIST "
%PLUGIN_BINARY_FILE_PATH%" echo There was an compilation error. Exiting... & goto end



::
:: Copy the compiled plugin to the game folder(s)
::
echo.
echo 1 File(s) copied, to the folder %PLUGIN_BINARY_FILE_PATH%

:: Initial array index to loop into.
set "
currentIndex=0"

:: Loop throw all games to install the new files.
:SymLoop

:: Update the next 'for/array' index to copy/install.
set /a "
currentIndex+=1"

if defined folders_list[%currentIndex%] (

    :: Some how the AMXX compiler could not compiling/copied some times, so let us know when it does not.
    setlocal EnableDelayedExpansion

    IF NOT EXIST "
!folders_list[%currentIndex%]!" (
        echo Error: The destine folder does not exists: !folders_list[%currentIndex%]!
        goto :SymLoop
    )

    :: Try to delete the file only if it exists
    IF EXIST "
!folders_list[%currentIndex%]!\%PLUGIN_BASE_FILE_NAME%.amxx" del "!folders_list[%currentIndex%]!\%PLUGIN_BASE_FILE_NAME%.amxx"

    :: To do the actual copying/installing.
    for /f "
delims=" %%a in ( 'xcopy /S /Y "%PLUGIN_BINARY_FILE_PATH%"^
            "
!folders_list[%currentIndex%]!"^|find /v "%PLUGIN_BASE_FILE_NAME%"' ) do echo %%a, to the folder !folders_list[%currentIndex%]!

    goto :SymLoop
)


::
:: Subroutines/Function calls
::
goto :end

:: This one must to be on the `enabledelayedexpansion` range
:path_from_file_name <resultVar> <pathVar>
(
    set "
%~1=%~dp2"
    exit /b
)



::
:: The end of the compilation
::
:end

:: Calculating the duration is easy
for /F "
tokens=1-4 delims=:.," %%a in ("%time%") do (
   set /A "
end=(((%%a*60)+1%%%% 100)*60+1%%%% 100)*100+1%%%% 100"
)

:: Get elapsed time
set /A elapsed=end-start

:: Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%

:: Outputting
echo.
echo Took %hh%:%mm%:%ss%,%cc% seconds to run this script.

:: Pause the script for result reading, when it is run without any command line parameters
echo.
if "
%PLUGIN_SOURCE_CODE_FILE_PATH%"=="" pause 
It stills reads the include files from the wrong compiler.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-30-2018 , 19:33   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #115

Can you edit the first line `@echo off` and change it to `@echo on`?

This will enable the debug mode. Then, you can run the this script, and post here the output?

That change I mentioned before, I already included it. But it is commented out here:
PHP Code:
:: To call the compiler to compile the plugin to the output folder $PLUGIN_BINARY_FILE_PATH
:: Comment the following line and uncomment the next line to it, if you not want to override your compiler files
"%AMXX_COMPILER_PATH%" -i"%SOURCE_CODE_INCLUDE_FOLDER%" -o"%PLUGIN_BINARY_FILE_PATH%" "%PLUGIN_SOURCE_CODE_FILE_PATH%"
:: "%AMXX_COMPILER_PATH%" -i"%COMPILER_INCLUDE_FOLDER_PATH%" -i"%SOURCE_CODE_INCLUDE_FOLDER%" -o"%PLUGIN_BINARY_FILE_PATH%" "%PLUGIN_SOURCE_CODE_FILE_PATH%" 
You need to change it to:
PHP Code:
:: To call the compiler to compile the plugin to the output folder $PLUGIN_BINARY_FILE_PATH
:: Comment the following line and uncomment the next line to it, if you not want to override your compiler files
:: "%AMXX_COMPILER_PATH%" -i"%SOURCE_CODE_INCLUDE_FOLDER%" -o"%PLUGIN_BINARY_FILE_PATH%" "%PLUGIN_SOURCE_CODE_FILE_PATH%"
"%AMXX_COMPILER_PATH%" 
-i"%COMPILER_INCLUDE_FOLDER_PATH%" -i"%SOURCE_CODE_INCLUDE_FOLDER%" -o"%PLUGIN_BINARY_FILE_PATH%" "%PLUGIN_SOURCE_CODE_FILE_PATH%" 
i.e., uncomment the first line and comment the next one to it.

Also, where is located your input .sma file? It has a `include` folder or an `amxxpc.exe` next to it?
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 07-30-2018 at 19:33.
addons_zz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-31-2018 , 08:13   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #116

Actually, my .sma file is located in the Dust2+Respawn server, but I'm trying to compile it with the Deathrun server compiler which is in a totally different directory. This may be the problem.

I just tested it and it works if I try to compile from Deathrun to Dust2+Respawn, but not the other way around. That's strange.
Both amxxpc.exe and the include folder are located in the scripting folder in both servers.

Here's the log when compiling to Deathrun with the Deathrun compiler (this one works):

PHP Code:
E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>for /F %i in ('date /T') do set CURRENT_DATE=%i 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set CURRENT_DATE=31.07.2018 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>echo.


E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>echo Compiling test... Current time is: 14:10:39.75 - 31.07.2018 
Compiling test... Current time is14:10:39.75 31.07.2018

E
:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>echo.


E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "folders_list[0]=E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "AMXX_COMPILER_PATH=E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting\amxxpc.exe" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>for /F "tokens=1-4 delims=:.," %a in ("14:10:39.75") do (set /A "start=(((%a*60)+1%b % 100)*60+1%c % 100)*100+1%d % 100" ) 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>(set /A "start=(((14*60)+110 % 100)*60+139 % 100)*100+175 % 100" ) 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "PLUGIN_SOURCE_CODE_FILE_PATH="E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting\test.sma"" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "PLUGIN_SOURCE_CODE_FILE_PATH=E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting\test.sma" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "SOURCE_CODE_FOLDER="E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting"" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "SOURCE_CODE_FOLDER=E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "SOURCE_CODE_INCLUDE_FOLDER=E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting\include" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "PLUGIN_BASE_FILE_NAME=test" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "PLUGIN_BASE_FILE_NAME=test" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "PLUGIN_BINARY_FILE_PATH=E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>IF "test" == "" echo You must to save the plugin before to compile it.   & goto end 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>setlocal enabledelayedexpansion enableextensions 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>call :path_from_file_name AMXX_COMPILER_FOLDER !AMXX_COMPILER_PATH! 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>(
set "AMXX_COMPILER_FOLDER=E:\OciXCrom\Servers\"  
 exit /b 


E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>endlocal   & (set "
AMXX_COMPILER_FOLDER=E:\OciXCrom\Servers\" ) 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "
COMPILER_INCLUDE_FOLDER_PATH=E:\OciXCrom\Servers\include

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>IF EXIST "
E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx" del "E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>"E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting\amxxpc.exe" -i"E:\OciXCrom\Servers\include" -i"E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting\include" -o"E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx" "E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting\test.sma" 
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Header size
:            116 bytes
Code size
:              120 bytes
Data size
:               56 bytes
Stack
/heap size:      16384 bytesestimated maxusage=39 cells (156 bytes)
Total requirements:   16676 bytes
Done
.

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>IF NOT EXIST "E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx" echo There was an compilation error. Exiting...   & goto end 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>echo.


E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>echo 1 File(s) copied, to the folder E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx 
1 File(scopiedto the folder E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set "currentIndex=0" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set /a "currentIndex+=1" 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>if defined folders_list[1] (
setlocal EnableDelayedExpansion  
 
IF NOT EXIST "!folders_list[1]!" (
echo 
ErrorThe destine folder does not exists: !folders_list[1]!  
 goto :
SymLoop 
)  
 IF 
EXIST "!folders_list[1]!\test.amxx" del "!folders_list[1]!\test.amxx"  
 
for /"delims=" %a in ('xcopy /S /Y "E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx"  "!folders_list[1]!"|find /v "test"') do echo %ato the folder !folders_list[1]!  
 goto :
SymLoop 


E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>goto :end 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>for /F "tokens=1-4 delims=:.," %a in ("14:10:39.83") do (set /A "end=(((%a*60)+1%b % 100)*60+1%c % 100)*100+1%d % 100" ) 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>(set /A "end=(((14*60)+110 % 100)*60+139 % 100)*100+183 % 100" ) 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set /A elapsed=end-start 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>set /A hh=elapsed/(60*60*100), rest=elapsed%(60*60*100), mm=rest/(60*100), rest%=60*100, ss=rest/100, cc=rest%100 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>if 0 LSS 10 set mm=00 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>if 0 LSS 10 set ss=00 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>if 8 LSS 10 set cc=08 

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>echo.


E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>echo Took 0:00:00,08 seconds to run this script. 
Took 0:00:00,08 seconds to run this script.

E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>echo.


E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting>if "E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting\test.sma" == "" pause
[Finished in 0.1s
Here's the error log when compiling to Deathrun from Dust2+Respawn (this one doesn't work, the include files are read from Dust2+Respawn instead of Deathrun).

PHP Code:
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>for /%i in ('date /T') do set CURRENT_DATE=%

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set CURRENT_DATE=31.07.2018 

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>echo.


E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>echo Compiling test... Current time is14:04:58.42 31.07.2018 
Compiling test
... Current time is14:04:58.42 31.07.2018

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>echo.


E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "folders_list[0]=E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "AMXX_COMPILER_PATH=E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting\amxxpc.exe" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>for /"tokens=1-4 delims=:.," %a in ("14:04:58.42") do (set /"start=(((%a*60)+1%b % 100)*60+1%c % 100)*100+1%d % 100" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>(set /"start=(((14*60)+104 % 100)*60+158 % 100)*100+142 % 100" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "PLUGIN_SOURCE_CODE_FILE_PATH="E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\test.sma"" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "PLUGIN_SOURCE_CODE_FILE_PATH=E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\test.sma" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "SOURCE_CODE_FOLDER="E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting"" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "SOURCE_CODE_FOLDER=E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "SOURCE_CODE_INCLUDE_FOLDER=E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "PLUGIN_BASE_FILE_NAME=test" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "PLUGIN_BASE_FILE_NAME=test" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "PLUGIN_BINARY_FILE_PATH=E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>IF "test" == "" echo You must to save the plugin before to compile it.   & goto end 

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>setlocal enabledelayedexpansion enableextensions 

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>call :path_from_file_name AMXX_COMPILER_FOLDER !AMXX_COMPILER_PATH

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>(
set "AMXX_COMPILER_FOLDER=E:\OciXCrom\Servers\"  
 exit /b 


E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>endlocal   & (set "
AMXX_COMPILER_FOLDER=E:\OciXCrom\Servers\" ) 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set "
COMPILER_INCLUDE_FOLDER_PATH=E:\OciXCrom\Servers\include

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>IF EXIST "
E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx" del "E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>"E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\scripting\amxxpc.exe" -i"E:\OciXCrom\Servers\include" -i"E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include" -o"E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx" "E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\test.sma" 
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxconst.inc(50) : error 056arrayslocal variables and function arguments cannot be public (variable "NULL_STRING")
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxconst.inc(55) : error 056arrayslocal variables and function arguments cannot be public (variable "NULL_VECTOR")
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\string_stocks.inc(91) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\string_stocks.inc(91) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(178) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(178) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(2549) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(2549) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(2561) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(2561) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(2609) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(2609) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(2620) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(2620) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(2632) : warning 207unknown #pragma
E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\amxmodx.inc(2632) : error 038extra characters on line
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(1859) : warning 200symbol "Ham_DOD_Weapon_PlayerIsWaterSni" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(2628) : warning 200symbol "Ham_ESF_Weapon_HolsterWhenMelee" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(2697) : warning 200symbol "Ham_NS_EffectivePlayerClassChan" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(2802) : warning 200symbol "Ham_NS_Weapon_GetWeaponPrimeTim" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(2826) : warning 200symbol "Ham_NS_Weapon_GetIsWeaponPrimin" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(3271) : warning 200symbol "Ham_SC_CheckAndApplyGenericAtta" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(3320) : warning 200symbol "Ham_SC_Player_MenuInputPerforme" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(3416) : warning 200symbol "Ham_SC_Player_TimeToStartNextVo" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(3448) : warning 200symbol "Ham_SC_Player_DisableCollisionW" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(3456) : warning 200symbol "Ham_SC_Player_EnableCollisionWi" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(3530) : warning 200symbol "Ham_SC_Weapon_PrecacheCustomMod" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(3631) : warning 200symbol "Ham_TFC_Weapon_GetNextAttackDel" is truncated to 31 characters
E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\include\ham_const.inc(3699) : warning 200symbol "Ham_OPF_MySquadTalkMonsterPoint" is truncated to 31 characters

9 Errors
.
Could not locate output file E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amx (compile failed).

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>IF NOT EXIST "E:\OciXCrom\Servers\iPlay.bg Deathrun Unique [#4FUN]\cstrike\addons\amxmodx\plugins\test.amxx" echo There was an compilation errorExiting...   & goto end 
There was an compilation error
Exiting... 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>for /"tokens=1-4 delims=:.," %a in ("14:04:58.69") do (set /"end=(((%a*60)+1%b % 100)*60+1%c % 100)*100+1%d % 100" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>(set /"end=(((14*60)+104 % 100)*60+158 % 100)*100+169 % 100" 

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set /A elapsed=end-start 

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>set /A hh=elapsed/(60*60*100), rest=elapsed%(60*60*100), mm=rest/(60*100), rest%=60*100ss=rest/100cc=rest%100 

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>if 0 LSS 10 set mm=00 

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>if 0 LSS 10 set ss=00 

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>if 27 LSS 10 set cc=027 

E
:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>echo.


E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>echo Took 0:00:00,27 seconds to run this script
Took 0:00:00,27 seconds to run this script.

E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>echo.


E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting>if "E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\test.sma" == "" pause
[Finished in 0.3s
So, basically:
  • Compiling from Dust2+Respawn to Dust2+Respawn => works
  • Compiling from Dust2+Respawn to Deathrun => doesn't work
  • Compiling from Deathrun to Deathrun => works
  • Compiling from Deathrun to Dust2+Respawn => works

Edit: now I tried adding more compilers, one of them called Furien. I tried to compile from Furien to Furien and it used the Dust2+Respawn include files?! Something is very messed up here.
__________________

Last edited by OciXCrom; 07-31-2018 at 08:22.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-31-2018 , 11:36   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #117

Try using this version:
PHP Code:
@echo on

:: AMXX Plugin Compiler Script
::
::  
This program is free softwareyou can redistribute it and/or modify it
::  under the terms of the GNU General Public License as published by the
::  Free Software Foundationeither version 2 of the License, or ( at
::  your option any later version.
::
::  
This program is distributed in the hope that it will be usefulbut
::  WITHOUT ANY WARRANTYwithout even the implied warranty of
::  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
::  
See the GNU General Public License for more details.
::
::  
You should have received a copy of the GNU General Public License
::  along with this program.  If notsee <http://www.gnu.org/licenses/>.
::


:: 
Get the current date to the variable CURRENT_DATE
for /%%i in ('date /T') do set CURRENT_DATE=%%i

:: The format of %TIMEis HH:MM:SS,CS for example 23:59:59,99
echo.
echo 
Compiling %2... Current time is: %TIME% - %CURRENT_DATE%
echo.

:: 
Put here the paths to the folders where do you want to install the plugin.
:: 
You must to provide at least one folder.
set "folders_list[0]=E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\plugins"

:: Where is your compiler?
::
:: 
Example:
:: 
F:\SteamCMD\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\amxxpc.exe
::
set "AMXX_COMPILER_PATH=E:\OciXCrom\Servers\iPlay.bg Dust2+Respawn\cstrike\addons\amxmodx\scripting\amxxpc.exe"





::
:: 
Setup the time calculation script
::
:: 
Time calculation downloaded from:
:: 
http://stackoverflow.com/questions/9922498/calculate-time-difference-in-windows-batch-file
::
:: 
AMX Mod X compiling batch downloaded from:
:: 
https://github.com/alliedmodders/amxmodx/pull/212/commits

:: Here begins the command you want to measure
for /"tokens=1-4 delims=:.," %%a in ("%time%") do (
   
set /"start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)


::
:: 
Setup the batch variables
:: Example: $1=F:\SteamCMD\steamapps\common\Half-Life\czero\addons\my_plugin.sma
::
:: $
1 is the first shell argument and $2 is the second shell argument passed by AmxxEditor.sublime-build
:: Usually they should be the plugin's file full path and the plugin's file name without extension.
::
:: 
Removing double quotes from variables in batch file creates problems with CMD environment
:: https://stackoverflow.com/questions/1964192/removing-double-quotes-from-variables-in-batch-file-creates-problems-with-cmd-en
set "PLUGIN_SOURCE_CODE_FILE_PATH=%1"
set "PLUGIN_SOURCE_CODE_FILE_PATH=%PLUGIN_SOURCE_CODE_FILE_PATH:"=%"

:: $4 is the path of the folder where the plugin source code is.
:: Example F:\SteamCMD\steamapps\common\Half-Life\czero\addons\
set "
SOURCE_CODE_FOLDER=%4"
set "
SOURCE_CODE_FOLDER=%SOURCE_CODE_FOLDER:"=%"
set "SOURCE_CODE_INCLUDE_FOLDER=%SOURCE_CODE_FOLDER%\include"

:: Example: $2="my_plugin"
set "PLUGIN_BASE_FILE_NAME=%2"
set "PLUGIN_BASE_FILE_NAME=%PLUGIN_BASE_FILE_NAME:"=%"
set "
PLUGIN_BINARY_FILE_PATH=%folders_list[0]%\%PLUGIN_BASE_FILE_NAME%.amxx"

:: Set a path variable with spaces in the path in a Windows .cmd file or batch file
:: https://stackoverflow.com/questions/1851012/set-a-path-variable-with-spaces-in-the-path-in-a-windows-cmd-file-or-batch-file
IF "
%PLUGIN_BASE_FILE_NAME%"=="" echo You must to save the plugin before to compile it. & goto end



::
:: Compile the AMXX plugin
:compile_the_plugin

:: Build the compiler include folder path
:: https://stackoverflow.com/questions/15567809/batch-extract-path-and-filename-from-a-variable
:: set AMXX_COMPILER_PATH=C:\Somewhere\Somewhere\SomeFile.txt
FOR /F "
delims=" %%i IN ("%AMXX_COMPILER_PATH%") DO (
set "
AMXX_COMPILER_FOLDER=%%~pi"
)

:: Build the compiler include folder path
set "
COMPILER_INCLUDE_FOLDER_PATH=%AMXX_COMPILER_FOLDER%include"

:: Delete the old binary in case some crazy problem on the compiler, or in the system while copy it.
:: So, this way there is not way you are going to use the wrong version of the plugin without knowing it.
IF EXIST "
%PLUGIN_BINARY_FILE_PATH%" del "%PLUGIN_BINARY_FILE_PATH%"

:: To call the compiler to compile the plugin to the output folder 
$PLUGIN_BINARY_FILE_PATH
:: Comment the following line and uncomment the next line to it, if you not want to override your compiler files
:: "
%AMXX_COMPILER_PATH%" -i"%SOURCE_CODE_INCLUDE_FOLDER%" -o"%PLUGIN_BINARY_FILE_PATH%" "%PLUGIN_SOURCE_CODE_FILE_PATH%"
"
%AMXX_COMPILER_PATH%" -i"%COMPILER_INCLUDE_FOLDER_PATH%" -i"%SOURCE_CODE_INCLUDE_FOLDER%" -o"%PLUGIN_BINARY_FILE_PATH%" "%PLUGIN_SOURCE_CODE_FILE_PATH%"

:: If there was a compilation error, there is nothing more to be done.
IF NOT EXIST "
%PLUGIN_BINARY_FILE_PATH%" echo There was an compilation error. Exiting... & goto end



::
:: Copy the compiled plugin to the game folder(s)
::
echo.
echo 1 File(s) copied, to the folder %PLUGIN_BINARY_FILE_PATH%

:: Initial array index to loop into.
set "
currentIndex=0"

:: Loop throw all games to install the new files.
:SymLoop

:: Update the next 'for/array' index to copy/install.
set /a "
currentIndex+=1"

if defined folders_list[%currentIndex%] (

    :: Some how the AMXX compiler could not compiling/copied some times, so let us know when it does not.
    setlocal EnableDelayedExpansion

    IF NOT EXIST "
!folders_list[%currentIndex%]!" (
        echo Error: The destine folder does not exists: !folders_list[%currentIndex%]!
        goto :SymLoop
    )

    :: Try to delete the file only if it exists
    IF EXIST "
!folders_list[%currentIndex%]!\%PLUGIN_BASE_FILE_NAME%.amxx" del "!folders_list[%currentIndex%]!\%PLUGIN_BASE_FILE_NAME%.amxx"

    :: To do the actual copying/installing.
    for /f "
delims=" %%a in ( 'xcopy /S /Y "%PLUGIN_BINARY_FILE_PATH%"^
            "
!folders_list[%currentIndex%]!"^|find /v "%PLUGIN_BASE_FILE_NAME%"' ) do echo %%a, to the folder !folders_list[%currentIndex%]!

    goto :SymLoop
)



::
:: The end of the compilation
::
:end

:: Calculating the duration is easy
for /F "
tokens=1-4 delims=:.," %%a in ("%time%") do (
   set /A "
end=(((%%a*60)+1%%%% 100)*60+1%%%% 100)*100+1%%%% 100"
)

:: Get elapsed time
set /A elapsed=end-start

:: Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%

:: Outputting
echo.
echo Took %hh%:%mm%:%ss%,%cc% seconds to run this script.

:: Pause the script for result reading, when it is run without any command line parameters
echo.
if "
%PLUGIN_SOURCE_CODE_FILE_PATH%"=="" pause 
If does not work, post the new log.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 07-31-2018 at 11:37.
addons_zz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-31-2018 , 14:53   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #118

It seems to be working perfectly now. Thanks!
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 08-02-2018 , 23:27   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #119

how you add multiple compiler i want too 1 for 1.8.2 and 1 for 1.8.3
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-03-2018 , 08:19   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #120

Quote:
Originally Posted by soumyadip77 View Post
how you add multiple compiler i want too 1 for 1.8.2 and 1 for 1.8.3
Then look at the comments on the previous pages?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode