MUD Scripting checklist for MUDs
This checklist provides a technical framework for validating MUD scripts, plugins, and server-side logic before deployment. It ensures stability, performance, and maintainability across common clients like Mudlet and TinTin++, and server environments using LPC or Lua.

Error Handling and Fault Tolerance
0/5Lua Protected Calls (pcall)
criticalWrap all external API calls and high-risk logic in pcall() or xpcall() to prevent script crashes from halting the entire client session.
Graceful Degradation on Disconnect
criticalVerify that scripts stop sending commands and clear all active timers or 'tempTimers' immediately upon game disconnection to prevent buffer overflows on reconnect.
Log File Validation
recommendedConfirm that script-specific error logs are written to a dedicated directory and do not exceed 10MB in size to prevent disk bloat.
Input Sanitization
criticalEnsure all user-provided alias arguments are escaped before being passed to the 'send' or 'expand' functions to prevent command injection.
Default State Recovery
recommendedImplement a 'reset' function that clears all variables and returns the script to a known-good state without requiring a client restart.
Performance and Resource Management
0/5Regex Anchor Optimization
criticalVerify that all triggers use line-start (^) or line-end ($) anchors where possible to reduce the regex engine's search space per line.
Global Variable Pollution Check
criticalAudit code to ensure variables are declared with 'local' scope unless they must be shared across the entire environment.
Timer Cleanup Logic
criticalCheck that every recurring timer has a corresponding 'kill' or 'stop' mechanism to prevent memory leaks and 'ghost' script execution.
Event Handler Throttling
recommendedEnsure scripts listening to high-frequency events (like 'sysWindowResizeEvent' or 'gmcp.Char.Vitals') use a debounce or throttle to limit execution frequency.
JSON/Table Serialization Efficiency
optionalTest that large data tables are saved to disk using a fast serializer (like yajl or lfs) rather than basic string concatenation.
Namespace and Compatibility
0/5Unique Package Prefixing
criticalEnsure all functions and global tables are nested under a single unique top-level table (e.g., MyPluginName.core) to avoid collisions with other scripts.
Minimum Client Version Check
recommendedImplement a startup check that verifies the MUD client version meets the script's API requirements and alerts the user if it is outdated.
GMCP/MSDP Capability Negotiation
criticalVerify that scripts wait for a 'Protocol Enabled' event before attempting to parse GMCP or MSDP data packets.
Cross-Platform Path Handling
criticalEnsure file paths use the client's internal directory variables (e.g., getMudletHomeDir()) instead of hardcoded Windows or Linux paths.
Dependency Resolution
recommendedCheck for the existence of required external libraries (like LuaSQL or LuaFileSystem) during the initialization phase.
User Interface and Feedback
0/5Console Echo Standardization
recommendedUse a consistent prefix and color for script-generated messages to distinguish them from MUD output and other plugins.
Automation Toggle Visibility
recommendedProvide a clear visual indicator (gauge, label, or echo) showing whether 'Combat' or 'Auto-loot' scripts are currently active.
Configuration GUI/CLI
recommendedVerify that all user-adjustable settings can be modified via an alias or menu without editing the source code.
Help Documentation Command
recommendedImplement a 'scriptname help' command that lists all available aliases and their syntax within the client console.
Verbosity Levels
optionalInclude a 'debug' or 'verbose' mode that can be toggled to show hidden script logic for troubleshooting.
LPC and Server-Side Specifics
0/5Inheritance Chain Validation
criticalVerify that the object correctly inherits from the standard library (std/container, std/room) and calls ::create() or ::reset() properly.
Apply Function Security
criticalEnsure 'apply' functions (like valid_read or valid_write) check the effective user ID (geteuid) before granting file access.
Heartbeat Optimization
recommendedConfirm that set_heart_beat(0) is called when an object is idle to reduce server-side CPU overhead.
Shadow Object Cleanup
criticalVerify that any LPC shadows are automatically removed when the base object is destructed to prevent orphaned logic.
Save File Integrity
recommendedTest that save_object() and restore_object() handle data corruption by falling back to default values if the .o file is unreadable.
Deployment and Distribution
0/5Package Export Verification
criticalExport the script as a .mpackage or .xml and import it into a clean client profile to ensure no local dependencies were missed.
Version Metadata
recommendedInclude a version string and timestamp in the script's main table to assist with remote update checks.
License and Credit Inclusion
recommendedEnsure a comment block at the top of the main script file includes the license type (e.g., MIT, GPL) and author contact information.
Update Hook Implementation
optionalProvide a mechanism for the script to migrate old configuration data to a new format when a version update is detected.
Asset Path Bundling
criticalVerify that all external images, sounds, or CSS files are referenced using relative paths within the script's package folder.