Donut Team is a labor of love, built and maintained by a small group of passionate developers. We invest our own time and resources to offer our tools, mods, and web services completely free of charge.

We don't run ads, and we will never sell your data - period.

If you've enjoyed anything we've created, please consider supporting our work with a one-time or monthly donation via our Ko-fi page . Every contribution helps us continue building great experiences for the community.

Dismiss
Icon image for MFK To Lua

MFK To Lua

About This Tool

A tool to convert MFK or CON files from The Simpsons: Hit and Run to Game.lua scripts.

Prerequisites

How to use

Usage: MFKToLua [options] 

Options:
  -?, --help                        Show this help message and exit
  -o, --output                Set the output path
  -f, --force                       Force overwrite the output path if it exists

Useful scripts

A selection of example scripts to run all MFK or CON files in a directory through the tool.

Powershell:

$root = Read-Host "Enter root script path:"

if (-not (Test-Path $root)) {
	Write-Error "The specified path does not exist."
	exit 1
}

Get-ChildItem -Path $root -Recurse -Include *.mfk, *.con -File | ForEach-Object {
	$inputFile = $_.FullName
	$outputFile = [System.IO.Path]::ChangeExtension($inputFile, ".lua")

	Write-Host "Processing: $inputFile -> $outputFile"

	& ".\MFKToLua.exe" -o $outputFile $inputFile
}

Batch:

@echo off
setlocal enabledelayedexpansion

set /p root="Enter root script path: "

if not exist "%root%" (
	echo The specified path does not exist.
	exit /b 1
)

for /r "%root%" %%f in (*.mfk *.con) do (
	set "inputFile=%%f"
	set "outputFile=%%~dpnf.lua"

	echo Processing: !inputFile! -> !outputFile!

	".\MFKToLua.exe" -o "!outputFile!" "!inputFile!"
)

endlocal
pause

Bash:

#!/bin/bash

read -p "Enter root script path: " root

if [[ ! -d "$root" ]]; then
	echo "The specified path does not exist."
	exit 1
fi

find "$root" -type f \( -iname "*.mfk" -o -iname "*.con" \) | while read -r file; do
	output="${file%.*}.lua"
	echo "Processing: $file -> $output"
	./MFKToLua -o "$output" "$file"
done