This project is a script exporter that extracts Lua and Roblox scripts (e.g., Script, ModuleScript, LocalScript) from .rbxmx files within a given input directory and exports them to text files. It handles XML parsing of the .rbxmx files and outputs the script names, content, and directory location in a user-friendly way. Additionally, the project automatically splits large output files to ensure content remains manageable.
- Recursive Directory Parsing: Parses all directories within the provided input folder, extracting script files.
- Supports Multiple Script Types: Works with
.lua,.rbxmx, and LocalScripts. - Script Content Extraction: Extracts Lua script content, providing clear labels for script names, types, and locations.
- Output File Splitting: Automatically splits exported script content into multiple files if the content exceeds 30,000 characters.
- Automatic Output Cleanup: Clears all files in the output folder before running a new export to ensure no mixed or outdated data.
- Node.js: You need to have Node.js installed. You can download it here.
- NPM: Comes bundled with Node.js. Ensure you have the latest version.
- Clone the repository:
git clone https://github.com/yourusername/rbxmx-script-exporter.git
- Navigate into the directory:
cd rbxmx-script-exporter - Install dependencies:
npm install
- input: Place your
.rbxmxfiles or directories containing scripts here. - output: This is where the exported script files will be saved. Existing content in this directory is automatically deleted each time the script runs.
- utils: Contains utility functions (
parseDirectory.js,fileHelpers.js). - config.js: Configuration for specifying input and output paths.
To run the export script, use the following command:
node src/index.jsYou can configure input and output paths in the config.js file:
const path = require('path');
module.exports = {
inputDir: path.join(__dirname, '../input'), // Adjust to your actual input folder
outputDir: path.join(__dirname, '../output') // Directory for output files
};When the script runs successfully, you will see multiple files like:
export1.txtexport2.txt
Each file will contain the script names, locations, and content extracted from the .rbxmx files in the input directory.
src/index.js: The main entry point for the script export functionality.utils/parseDirectory.js: Handles directory traversal and script extraction.utils/fileHelpers.js: Contains helper functions for file operations, including writing output and clearing directories.config.js: Configuration file for specifying paths.
- The script will split output into multiple files if the content exceeds 30,000 characters.
- Ensure that the
outputfolder is writable, as all the extracted files will be stored there. - Script names, locations, and content are included for easy readability, particularly aimed at users reviewing extracted data.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/YourFeature). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- xml2js: Used to parse XML content from
.rbxmxfiles.