Jump to content

mtaluac.py (Open Source)


Berat Erdem

Recommended Posts

Posted (edited)

1. 🤖 What does it do? (Automatic Compilation and Obfuscation): Compile and protect your Lua files right from your desktop in seconds—no need to go through the hassle of manually uploading them to a website! ⚡

2. 🎯 Multi-File Support & Drag-and-Drop Convenience: Forget about complex commands or clunky interfaces; simply select multiple .lua files and drag-and-drop them onto the script all at once! 🖱️📦

3. 🔒 Customizable Obfuscation Levels: Secure your source code according to your needs with options ranging from [0] (None) to [3] (Maximum)! 🛡️

4. 💾 Secure Backup System: Automatically creates an .old backup file to ensure your original code is never accidentally overwritten! 🔄✨

5. 🌐 Official Source & 100% Open Source: It is completely open source 🔓 and routes all requests directly to the official https://luac.mtasa.com/ website! There are no intermediary servers (proxies) and absolutely no risks—use it with total peace of mind! 💯

6. 😍 You can drag and drop multiple files at the same time! :)

IMPORTANT 
Python 64 - BIT https://www.python.org/ftp/python/3.13.17/python-3.13.17-amd64.exe
Python 32 - BIT https://www.python.org/ftp/python/3.13.17/python-3.13.17.exe

Remember!
It will only work if you move the contents of the .lua file into a file with a .py extension.
If you try to run it as is, it won't work ❤️

If you do not do these things, it will not work, and the required library is as follows:

pip install requests

import requests
import os
import sys

URL = "https://luac.mtasa.com/"

headers = {
    "User-Agent": "Mozilla/5.0",
    "Referer": "https://luac.mtasa.com/",
    "Origin": "https://luac.mtasa.com"
}

def compile_lua_inplace(path, obfuscate_level="3", debug_mode="0"):
    if not path.lower().endswith(".lua"):
        print(f"Error: Selected file is not a Lua file -> {path}")
        return

    if not os.path.exists(path):
        print(f"Error: File not found -> {path}")
        return

    base_name = os.path.splitext(path)[0]
    old_path = base_name + ".old"

    if os.path.exists(old_path):
        print(f"Error: .old backup already exists for {os.path.basename(path)}. Skipped.")
        return

    with open(path, "rb") as f:
        original_content = f.read()

    with open(old_path, "wb") as f:
        f.write(original_content)

    print("Original file backed up →", old_path)

    files = {
        "luasource": (os.path.basename(path), original_content)
    }

    data = {
        "compile": "1",
        "debug": str(debug_mode),
        "obfuscate": str(obfuscate_level)
    }

    print(f"Compiling {os.path.basename(path)} with Obfuscation Level: {obfuscate_level} | Debug: {debug_mode}...")

    try:
        r = requests.post(
            URL,
            files=files,
            data=data,
            headers=headers,
            timeout=15
        )
    except Exception as e:
        print("Connection error:", e)
        return

    if r.status_code != 200 or b"<html" in r.content.lower():
        print(f"Compilation failed for {os.path.basename(path)}.")
        return

    with open(path, "wb") as f:
        f.write(r.content)

    print("Compilation successful →", path)


if len(sys.argv) < 2:
    print("Usage: Drag and drop one or more .lua files onto this script.")
else:
    print("Select Obfuscation Level:")
    print("  [0] None")
    print("  [1] Low")
    print("  [2] Medium")
    print("  [3] Maximum")
    
    choice = input("Enter level (0-3, default 3): ").strip()
    if choice not in ["0", "1", "2", "3"]:
        choice = "3"
        print("Invalid choice, defaulting to Level 3.")

    print(f"\nProcessing {len(sys.argv) - 1} file(s)...\n" + "-"*30)

    for lua_file in sys.argv[1:]:
        compile_lua_inplace(lua_file, obfuscate_level=choice)
        print("-" * 30)
    
    input("\nAll tasks completed. Press Enter to exit...")
    #BERAT ERDEM
    #https://forum.multitheftauto.com/profile/90671-berat-erdem/

 

Edited by Berat Erdem

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...