Hi-Tech API


Post url:

http://luac.mtasa.com/index.php

Post arguments:
Name Type Description
luasource file The file content
compile value Set to 1 to enable compilation
debug value Set to 1 to enable debug information
obfuscate value Set to 1 to enable some obfuscation
Set to 2 to enable more obfuscation

News about API changes


Linux example using curl:

FROM="example.lua"
TO="compiled.lua"
curl -s -X POST -F compile=1 -F debug=0 -F obfuscate=2 -F luasource=@$FROM http://luac.mtasa.com/ > $TO


Linux example using luac replacement:

luac_mta -e2 -o compiled.lua example.lua
if [ $? -ne 0 ]; then
   echo "Error"
fi

Get luac_mta (R11 2017-02-06) from http://nightly.mtasa.com/files/luac_mta




Windows batch file example using curl:

set FROM="example.lua"
set TO="compiled.lua"
curl.exe -s -X POST -F compile=1 -F debug=0 -F obfuscate=2 -F luasource=@%FROM% http://luac.mtasa.com/ > %TO%

Get curl.exe from http://nightly.mtasa.com/files/curl.exe
(Original from http://curl.haxx.se/download.html)

Windows example using luac.exe replacement:

luac_mta.exe -e2 -o compiled.lua example.lua
IF NOT ERRORLEVEL 1 goto lp1
   echo "Error"
:lp1

Get luac_mta.exe (R11 2017-02-06) from http://nightly.mtasa.com/files/luac_mta.exe




Lua example:

local FROM="example.lua"
local TO="compiled.lua"
fetchRemote( "http://luac.mtasa.com/?compile=1&debug=0&obfuscate=2", function(data) fileSave(TO,data) end, fileLoad(FROM), true )