Resources

100 MUSHclient resources for MUD players

MUSHclient remains a premier choice for Windows-based MUDding due to its deep Lua integration and mature plugin architecture. This resource guide provides technical specifics for developers and power users to leverage the internal API, manage cross-platform compatibility via Wine, and streamline script development.

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

Core Plugin API and Scripting Functions

  1. 1

    world.GetVariable / world.SetVariable

    beginnerstandard

    Primary methods for persistent data storage within the world file. Variables stored this way survive client restarts.

  2. 2

    world.DoAfter / world.DoAfterSpecial

    beginnerhigh

    Executes a command or script after a specified delay. Use DoAfterSpecial for higher precision and control over script evaluation.

  3. 3

    world.Send

    beginnerstandard

    Sends a raw string directly to the MUD server. Essential for basic automation and alias responses.

  4. 4

    world.AddTrigger / world.AddAlias

    intermediatehigh

    Programmatically creates triggers and aliases. Useful for plugins that need to dynamically adapt to game states.

  5. 5

    world.Note

    beginnerstandard

    Outputs text directly to the MUSHclient output window without sending it to the server. Use for debugging and local status updates.

  6. 6

    world.Execute

    beginnerstandard

    Forces the client to process a string as if the user typed it, allowing it to trigger existing aliases.

  7. 7

    world.GetInfo

    intermediatemedium

    Retrieves client state information (e.g., GetInfo(2) for OS version, GetInfo(20) for world name).

  8. 8

    world.EnableTrigger / world.EnableAlias

    beginnerhigh

    Toggles the active state of specific triggers or aliases by name. Key for managing state-based logic (e.g., combat modes).

  9. 9

    world.GetPluginVariable

    advancedhigh

    Retrieves a variable value from a different loaded plugin using its Unique ID. Vital for inter-plugin communication.

  10. 10

    world.CallPlugin

    advancedhigh

    Executes a function defined in another plugin. Requires the function to be exported in the target plugin's script.

  11. 11

    world.SaveState

    intermediatemedium

    Forces an immediate save of variables and configuration to the disk to prevent data loss on crashes.

  12. 12

    world.DeleteVariable

    beginnerstandard

    Removes a variable from the world's persistent storage to manage memory and clean up temporary state.

  13. 13

    world.ColourNote

    intermediatemedium

    Outputs colored text to the local window using ANSI color codes or RGB values. Useful for custom UI messages.

  14. 14

    world.GetLineCount

    intermediatestandard

    Returns the number of lines currently in the output buffer, used for parsing history or logging scripts.

  15. 15

    world.Tell

    beginnerstandard

    Appends text to the output window without a newline. Allows for building complex local lines piece by piece.

Miniwindow UI Development

  1. 1

    WindowCreate

    intermediatehigh

    Initializes a miniwindow surface. Requires a unique window ID, position, size, and background color.

  2. 2

    WindowRectOp

    intermediatestandard

    Performs drawing operations like filling rectangles, drawing borders, or clearing areas within a miniwindow.

  3. 3

    WindowText

    intermediatehigh

    Renders text into a miniwindow. Supports font selection and precise X/Y coordinate placement.

  4. 4

    WindowHotspot

    advancedhigh

    Defines an interactive area within a miniwindow that responds to mouse clicks, hovers, and drags.

  5. 5

    WindowImage

    intermediatemedium

    Loads and displays external BMP or PNG images within the UI. Essential for graphical HUDs and maps.

  6. 6

    WindowLine

    intermediatestandard

    Draws lines between two points. Used for creating health bars, separators, and custom borders.

  7. 7

    WindowCircleOp

    intermediatestandard

    Draws circles or ellipses. Useful for cooldown timers or circular status indicators.

  8. 8

    WindowPolygon

    advancedmedium

    Draws complex shapes by defining a set of vertices. Required for custom map rendering.

  9. 9

    WindowShow

    beginnerstandard

    Controls the visibility of a miniwindow. Allows for toggling UI elements like inventories or maps.

  10. 10

    WindowFont

    intermediatestandard

    Loads a specific font into memory for use with WindowText. Supports anti-aliasing and bold/italic styles.

  11. 11

    WindowMenu

    advancedmedium

    Creates a popup context menu when a user interacts with a hotspot. Great for right-click functionality.

  12. 12

    WindowDragHandler

    advancedhigh

    Implements logic to allow users to move miniwindows around the screen and save their positions.

Advanced Scripting and External Integration

  1. 1

    Lua SQLite3 Integration

    advancedhigh

    MUSHclient includes the lsqlite3 library. Use this for large-scale data storage like mob databases or item logs.

  2. 2

    Lua rex (PCRE) Library

    intermediatehigh

    Provides Perl-compatible regular expressions. Far more powerful than standard Lua patterns for complex trigger matching.

  3. 3

    OnPluginInstall Callback

    intermediatestandard

    Standard function called when a plugin is loaded. Use this to initialize variables and set up UI elements.

  4. 4

    OnPluginBroadcast Callback

    advancedhigh

    Listens for messages broadcast by other plugins. The primary mechanism for event-driven multi-plugin systems.

  5. 5

    Lua bitop Library

    advancedmedium

    Enables bitwise operations in Lua 5.1, necessary for handling certain network protocols and binary data formats.

  6. 6

    External Editor Integration

    beginnerstandard

    Configure MUSHclient to open scripts in VS Code or Notepad++ instead of the built-in editor for better syntax highlighting.

  7. 7

    Wine Configuration for Linux/macOS

    intermediatemedium

    Use 'winetricks corefonts' and 'winetricks lucida' to fix font rendering issues when running MUSHclient on non-Windows systems.

  8. 8

    XML Plugin Structure

    intermediatehigh

    Manual editing of .xml plugin files to define aliases, triggers, and scripts in a single portable file.

  9. 9

    Lua Socket Support

    advancedhigh

    Enables external HTTP requests or socket connections. Used for fetching web data or integrating with Discord via webhooks.

  10. 10

    Handling ANSI Color Sequences

    intermediatestandard

    Using world.AnsiNote to preserve color codes from the MUD when echoing text locally or into miniwindows.