Posted by Kyle Hankinson June 16th, 2026
GMCP (Generic MUD Communication Protocol) lets a MUD send your client structured data out of band: your health, the current room, your inventory, and more. Instead of scraping that information out of the text on screen with fragile regular expressions, you can react to the data directly and reliably.
This post covers how to fire a trigger when a GMCP value changes, and how to read the data with getGMCP.
GMCP is enabled per connection and is on by default. You can toggle it in the connection editor. Two console commands help while you work:
Prints every GMCP value the MUD has sent so far, as formatted JSON. This is the quickest way to discover what your MUD exposes and the exact key names to match against.
Re-negotiates GMCP with the server if it was turned off.
The client flattens each GMCP package into dotted paths. If the MUD sends:
Char.Vitals { "hp": 100, "maxhp": 120, "mana": 50 }
the client stores:
Char.Vitals.hp = 100
Char.Vitals.maxhp = 120
Char.Vitals.mana = 50
Nested objects keep extending the path, so Room.Info { "name": "Town Square", "exits": { "north": "101" } } becomes Room.Info.name and Room.Info.exits.north.
In the trigger editor, set the match type to "variable updated (including GMCP)". The trigger's pattern is then a GMCP path, not a regular expression, and the trigger fires whenever the value at that path changes.
For example, a trigger with the pattern:
Char.Vitals.hp
fires every time your health changes. To watch several paths with a single trigger, separate them with a pipe:
Char.Vitals.hp | Char.Vitals.mana
Matching is case-insensitive by default.
When a GMCP trigger fires, the path that changed is available as \0, and you read values with getGMCP:
getGMCP('Char.Vitals.hp') returns the single value (for example 100).getGMCP('Char.Vitals') returns an object with everything under that branch: { hp: 100, maxhp: 120, mana: 50 }.Match type variable updated (including GMCP), pattern Char.Vitals.hp:
var hp = getGMCP('Char.Vitals.hp');
var max = getGMCP('Char.Vitals.maxhp');
// Show current health in the app icon badge.
badge(hp + '/' + max);
if (max && hp / max < 0.25) {
log('Warning: health is low (' + hp + '/' + max + ')');
beep();
}
Match type variable updated (including GMCP), pattern Room.Info.name:
status('Room: ' + getGMCP('Room.Info.name'));
#gmcp first to see exactly which packages and key names your MUD sends. Field names (for example hp versus maxhp) vary between MUDs.getGMCP inside the action to read the current value and decide what to do.getGMCP and setGMCP, and the Scripts post for sharing helper functions across triggers.