Mature Posted April 30, 2021 Share Posted April 30, 2021 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 comment
RomanDev Posted April 30, 2021 Share Posted April 30, 2021 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.multitheftauto.com/api/)? local TO = "compiled.lua" local FROM = "example.lua" fetchRemote( "https://luac.multitheftauto.com/?compile=1&debug=0&obfuscate=3", function(data) fileSave(TO, data) end, fileLoad(FROM), true) OR function obfuscateScript(rOne, rTwo) if (rOne and rTwo) then if (isObjectInACLGroup("resource."..getResourceName(getThisResource()), aclGetGroup("Admin"))) then fetchRemote( "https://luac.multitheftauto.com/?compile=1&debug=0&obfuscate=3", function() fileSave(rTwo, data) end , fileLoad(rOne), true) print("The script has been compiled!") else print("I don't have permissions.") end end end Link to comment
Mature Posted April 30, 2021 Author Share Posted April 30, 2021 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.multitheftauto.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 comment
RomanDev Posted April 30, 2021 Share Posted April 30, 2021 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.multitheftauto.com/ > compiled.lua`, (error,data,getter) =>{ if(error){ console.log("error", error.message) return; } if(getter){ console.log("data",data) } console.log("Arquivo compilado com sucesso!") }) leitor.close(); }); Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now