Jump to content

POST Node JS Compile API

Recommended Posts

Hello guys, well I'm looking for how to send a file to be encrypted by the MTA api, but I didn't have any results, could someone help me? I'm using the Node JS language, but a good explanation would help.

Link to post

Hello Mature, I didn't quite understand your question, but I think you want to use the luac API, correct? Have you seen this example that is attached to the API (https://luac.mtasa.com/api/)?

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


function obfuscateScript(rOne, rTwo)
    if (rOne and rTwo) then
        if (isObjectInACLGroup("resource."..getResourceName(getThisResource()), aclGetGroup("Admin"))) then
            fetchRemote( "http://luac.mtasa.com/?compile=1&debug=0&obfuscate=3", 
                    fileSave(rTwo, data) 
            , fileLoad(rOne), true)
            print("The script has been compiled!")
            print("I don't have permissions.")


Link to post
8 hours ago, RomanDev said:

Olá Mature, Não entendi muito bem sua dúvida, mas acho que você quer usar a API luac, correto? Você viu este exemplo anexado à API ( https://luac.mtasa.com/api/ )?




Hello, I want to know how I can send my file to compile with the MTA API, but not in .LUA but in JS through fetch.

Link to post

Ok, sorry! Code in JS: 

const {exec} = require("child_process");
var readline = require('readline');

var leitor = readline.createInterface({
    input: process.stdin,
    output: process.stdout
leitor.question("Arquivo para ser compilado: ", function(answer) {
    exec(`curl.exe -s -X POST -F compile=1 -F debug=0 -F obfuscate=3 -F luasource=@${answer} http://luac.mtasa.com/ > compiled.lua`, (error,data,getter) =>{
            console.log("error", error.message)
        console.log("Arquivo compilado com sucesso!")


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...