lime|sg Posted October 24, 2019 Share Posted October 24, 2019 (edited) Hello everyone! Can you help me, please? Question to those who understand PHP. Actually the question is as follows: On the site luac.multitheftauto.com in the API section there is a guide to compile Lua scripts by the Lua script itself: local FROM= "example.Lua" local TO= "compiled.Lua" fetchRemote("https://luac.multitheftauto.com/?compile=1&debug=0&obfuscate=3", function(data) fileSave(TO, date) end, fileLoad(FROM), true) Suppose there is a script on my website: $file_name = "my_script.Lua"; How can I compile this script in PHP? Maybe it is possible by using curl, but how to use it in PHP I don't know. Please help! Thanks. Edited October 24, 2019 by lime|sg Link to comment
Addlibs Posted October 25, 2019 Share Posted October 25, 2019 (edited) <?php $file_name = "my_script"; // filename without .Lua extension $body = file_get_contents($file_name.".Lua"); // Create a stream $opts = array( 'http'=>array( 'method'=>"POST", 'content' => $body // send the Lua code as body of the request ) ); $context = stream_context_create($opts); $compiled = file_get_contents('https://luac.multitheftauto.com/?compile=1&debug=0&obfuscate=3', false, $context); file_put_contents($file_name.".luac", $compiled); // save to same name but .luac ?> Edited October 25, 2019 by MrTasty changed http to https (even though there's https upgrade and hsts its always better to connect directly to https) 2 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