Mudlet checklist for MUDs
This checklist provides a technical framework for validating Mudlet script packages, ensuring code stability, performance optimization, and cross-platform compatibility for MUD players.

Namespacing and Script Organization
0/5Encapsulate in Global Tables
criticalEnsure all variables and functions are stored within a single unique table (e.g., MyProjectName = MyProjectName or {}) to prevent overwriting other scripts.
Folder Hierarchy Consolidation
criticalVerify all triggers, aliases, scripts, and timers are nested under one parent folder named after the package.
Localize Loop Variables
recommendedScan all scripts for 'for' and 'while' loops to ensure iterators are explicitly declared as 'local' to avoid global scope pollution.
Event Handler Registration
recommendedUse registerAnonymousEventHandler for script-side event binding rather than relying solely on the UI event box to ensure portability.
Modular Script Loading
optionalCheck that large codebases are split into logical script objects within the Mudlet editor rather than one giant file.
Trigger and Regex Optimization
0/5Regex Pattern Anchoring
recommendedUse '^' and '$' anchors in Perl Regex triggers where possible to prevent unnecessary mid-line scanning.
Substring Match Usage
recommendedConvert static text triggers from 'perl regex' to 'substring' or 'begin of line' to reduce CPU overhead.
Trigger State Management
criticalImplement disableTrigger() and enableTrigger() for combat-specific patterns so they only run when relevant.
Avoid Color-Trigger Dependency
recommendedEnsure triggers do not rely on specific ANSI colors unless necessary, as user themes or MUD settings may change them.
Multiline Trigger Gates
recommendedUse the 'multiline' trigger type with a line delta of 0 or 1 for complex patterns to ensure they only fire on specific sequence blocks.
GMCP and Data Handling
0/5GMCP Availability Check
criticalVerify the script checks for the existence of the 'gmcp' table before attempting to access nested data like 'gmcp.Char.Vitals'.
Shallow Copy for Updates
recommendedEnsure UI updates only trigger when GMCP values actually change, rather than on every incoming GMCP packet.
Fallback Mechanism
optionalProvide basic prompt-parsing triggers for users playing on MUDs that do not support GMCP or MSDP.
JSON Parsing Safety
criticalWrap custom yajl.to_value calls in pcall() to prevent script crashes if the server sends malformed JSON.
Coordinate Mapping Integration
recommendedVerify gmcp.Room.Info data correctly updates the Mudlet mapper ID via centerview() or setPlayerLocation().
User Interface and Geyser Layouts
0/5Geyser Framework Usage
criticalConfirm all UI elements (labels, gauges, consoles) use the Geyser or Vyzor libraries for automatic resolution scaling.
Container Nesting
recommendedCheck that all UI elements are attached to a Geyser.Container to allow for easy bulk hiding/showing.
Font Scaling Verification
recommendedTest UI readability at different font sizes (e.g., 10pt vs 16pt) to ensure text does not clip out of labels.
Main Console Buffer Margin
criticalEnsure the script calls setBorderRight() or setBorderBottom() so UI elements do not overlap the main game text.
Color Theme Compatibility
optionalTest UI visibility against both the default Mudlet dark theme and a high-contrast light theme.
Performance and Resource Management
0/5Timer ID Tracking
criticalStore IDs returned by tempTimer() in a table and kill them before starting new ones to prevent timer accumulation.
Garbage Collection Awareness
recommendedAvoid creating large temporary tables inside high-frequency triggers (like the prompt).
Stopwatch Profiling
optionalUse createStopwatch() and getStopwatchTime() to measure execution time of heavy functions during testing.
File I/O Pathing
criticalUse getMudletHomeDir() for all file operations to ensure paths work across Windows, Linux, and macOS.
Image Asset Validation
criticalConfirm all images used in labels are included in the .mpackage and referenced via relative paths.
Distribution and User Support
0/5Clean Profile Install Test
criticalInstall the package on a completely fresh Mudlet profile to identify missing dependencies or variables.
Version Variable Declaration
recommendedInclude a MyPackage.version string to allow for easy troubleshooting and update checks.
Help Alias Implementation
recommendedCreate a 'help' alias (e.g., 'pkg help') that displays a list of commands and current configuration status.
Conflict Check
criticalEnsure no aliases use extremely common short names (e.g., 's', 'k', 'c') without a toggle or specific prefix.
Uninstallation Script
optionalProvide a function or script that cleans up UI elements and global tables when the package is uninstalled.