Resources

100 MUD Scripting resources for MUD players

Advanced MUD scripting transforms the player experience from manual text entry to sophisticated automation and rich UI feedback. This resource provides technical implementations for client-side Lua frameworks, server-side LPC logic, and performance-driven trigger patterns to build maintainable systems for Mudlet, TinTin++, and modern LP MUDs.

100 MUD Scripting resources for MUD players illustration
Placeholder illustration shown while custom artwork is being produced.

Client-Side Frameworks and APIs

  1. 1

    Mudlet Geyser UI Framework

    intermediatehigh

    Utilize the Geyser object-oriented library to create resizable gauges, labels, and mini-consoles that automatically adjust to client window scaling.

  2. 2

    GMCP (Generic Mud Communication Protocol) Handling

    intermediatehigh

    Implement event handlers for 'sysDataSendRequest' to parse incoming JSON-like data for health, mana, and room coordinates without using regex on the main buffer.

  3. 3

    TinTin++ Variable Scoping

    beginnerstandard

    Use the #VARIABLE and #LOCAL commands to prevent namespace collisions in complex scripts, ensuring state is preserved across session reloads.

  4. 4

    MUSHclient Plugin XML Structure

    advancedmedium

    Encapsulate Lua scripts within XML plugin files to allow for modular distribution and independent script reloads without restarting the client.

  5. 5

    Mudlet tempTimer Logic

    beginnerstandard

    Use tempTimer for delayed execution in combat scripts, ensuring you pass unique IDs to avoid overlapping execution threads.

  6. 6

    SQLite Integration for Mudlet

    advancedhigh

    Use the built-in db: library to store item databases, mob vulnerabilities, and player kill logs for persistent data across sessions.

  7. 7

    TinTin++ Pathfinding with #PATH

    intermediatemedium

    Automate long-distance travel by recording room exits into a list and using the #PATH WALK command to retrace steps accurately.

  8. 8

    Lua Module Loading (require)

    intermediatestandard

    Organize large script collections into separate .lua files and load them via 'require' to maintain a clean Mudlet script tree.

  9. 9

    MSDP (MUD Server Data Protocol) Parsing

    advancedmedium

    Configure client triggers to listen for IAC SB MSDP sequences to update UI elements with server-side variables.

  10. 10

    Mudlet Event System (registerAnonymousEventHandler)

    intermediatehigh

    Decouple scripts by using custom events instead of direct function calls, allowing multiple modules to react to the same trigger.

Server-Side Scripting and Architecture

  1. 1

    LPC Inheritance Patterns

    intermediatehigh

    Define base 'std/monster' or 'std/room' objects and use the 'inherit' keyword to minimize code duplication in area building.

  2. 2

    Evennia Command Sets (CmdSets)

    advancedhigh

    Implement dynamic command availability by merging CmdSets based on player state, such as 'CombatSet' or 'InMenuSet'.

  3. 3

    LPC Mapping Data Structures

    beginnerstandard

    Use mappings ([ key : value ]) instead of parallel arrays for efficient lookups of item properties and mob resistances.

  4. 4

    FluffOS Efuns for Network I/O

    advancedmedium

    Leverage 'ext_sock_connect' and 'ext_sock_write' to allow your MUD to communicate with external Discord bots or web APIs.

  5. 5

    LPC heart_beat() Optimization

    intermediatehigh

    Limit the use of heart_beat() to active combatants; use 'set_heart_beat(0)' when an entity is idle to reduce CPU overhead.

  6. 6

    DGD Persistence Management

    advancedmedium

    Design objects to survive reboots by utilizing DGD's atomic persistence, ensuring player inventory state is never lost.

  7. 7

    LPC call_out() for Delayed Events

    beginnerstandard

    Implement non-blocking delays for quest triggers or environment changes using call_out(function, delay, args).

  8. 8

    Evennia Script Objects

    intermediatemedium

    Utilize Script objects for global systems like weather, economy, or time, separate from individual character or room instances.

  9. 9

    LPC Shadow Objects

    advancedmedium

    Use the 'shadow()' function to temporarily override methods on a player object, useful for status effects like 'Silence' or 'Confusion'.

  10. 10

    EFUN vs SFUN Performance

    intermediatestandard

    Prioritize built-in Efuns over simulated SFuns for intensive operations like string replacement or array sorting.

Automation and Trigger Logic

  1. 1

    PCRE Regex Optimization

    intermediatehigh

    Use non-capturing groups (?:...) and anchor triggers with ^ and $ to reduce the regex engine's backtracking overhead.

  2. 2

    Multi-line Trigger Buffers

    advancedmedium

    Implement state-based triggers that wait for a specific closing line before processing a block of text (e.g., room descriptions).

  3. 3

    Gagging and Filtering Logic

    beginnerstandard

    Use deleteLine() in Mudlet or #GAG in TinTin++ to remove combat spam while still parsing the hidden text for data.

  4. 4

    Finite State Machine (FSM) for Combat

    advancedhigh

    Design scripts that transition between states (Idle, Buffing, Attacking, Healing) to prevent command flooding and logic errors.

  5. 5

    Alias Nesting and Expansion

    beginnerstandard

    Create aliases that accept arguments ($1, $2) to build flexible command shortcuts that work across different target types.

  6. 6

    Color Trigger Parsing

    intermediatemedium

    Write triggers that specifically look for ANSI color codes to differentiate between player speech and system messages.

  7. 7

    Dynamic Pathfinding (Dijkstra)

    advancedhigh

    Implement a Dijkstra algorithm in Lua to calculate the shortest path between two room IDs based on a stored JSON map.

  8. 8

    Trigger Priorities

    beginnerstandard

    Assign numerical priorities to triggers to ensure critical safety scripts (like auto-flee) execute before cosmetic UI updates.

  9. 9

    Command Queuing Systems

    intermediatehigh

    Build a queue that respects the MUD's Global Cooldown (GCD), sending the next command only after receiving a 'Ready' prompt.

  10. 10

    Wait-for-Condition Loops

    advancedmedium

    Use coroutines in Lua to pause a script's execution until a specific trigger sets a 'ready' flag, avoiding messy nested callbacks.