GMCP in Aardwolf MUD using CMUD.


Cmud support for GMCP is available in Cmud 3.22 beta and higher. GMCP comes enabled by default in CMUD. To set high level GMCP modules supported, enter the 'protocols' section of 'preferences' and add/remove items as necessary in the "supported packages" window. Each of the options is included below. For most users, we recommend leaving the defaults enabled and adding a "Debug 1" option.

CMUD - trigger

A sample script to access/print room data in CMUD is:

#PRINT Continent:
#PRINT -----------------------------------------------

Which produces: info="num=16542|brief=A Quiet Section of the Swamp|zone=fens|sector=forest|flags|exits=""n=16543|s=16545|w=16541""|coord=""id=2|x=5|y=33""" n=16543|s=16545|w=16541 16543
Continent: 2

CMUD - trigger

The trigger below is a simple example to show data available in CMUD when GMCP messages are received. Whenever the player health changes, a GMCP message is sent to the client. The trigger is on a change in

The full code for this trigger is:

execwin stats { #clr }
#win stats {%ansi(high, white) --------------- Stats for -------------------%cr}
#win stats {%ansi(high, green)Class   : %ansi(high, white)%gmcp.char.base.class    
            %ansi(high, green)Subclass: %ansi(high, white)%gmcp.char.base.subclass}
#win stats {%ansi(high, green)Race    : %ansi(high, white)%gmcp.char.base.race        
            %ansi(high, green)Clan    : %ansi(high, white)%gmcp.char.base.clan}

#win stats {%cr%ansi(high, cyan)Strength     : %ansi(high, green)%gmcp.char.stats.str%ansi(high, white) /
               %ansi(high, green)%gmcp.char.maxstats.maxstr   %ansi(high, cyan)Health : %ansi(high, green)
               %gmcp.char.vitals.hp%ansi(high, white) / %ansi(high, green)%gmcp.char.maxstats.maxhp }
#win stats {%ansi(high, cyan)Intelligence : %ansi(high, green), white) /
               %ansi(high, green) %gmcp.char.maxstats.maxint   %ansi(high, cyan)Mana   : 
               %ansi(high, green)%gmcp.char.vitals.mana%ansi(high, white) / %ansi(high, green)%gmcp.char.maxstats.maxmana }
#win stats {%ansi(high, cyan)Wisdom       : %ansi(high, green)%gmcp.char.stats.wis%ansi(high, white) /
               %ansi(high, green) %gmcp.char.maxstats.maxwis  %ansi(high, cyan) Moves  : %ansi(high, green)
               %gmcp.char.vitals.moves%ansi(high, white) / %ansi(high, green)%gmcp.char.maxstats.maxmoves }
#win stats {%ansi(high, cyan)Dexterity    : %ansi(high, green)%gmcp.char.stats.dex%ansi(high, white)
               %ansi(high, white) / %ansi(high, green)%gmcp.char.maxstats.maxdex}
#win stats {%ansi(high, cyan)Constitution : %ansi(high, green)%gmcp.char.stats.con%ansi(high, white) /
                %ansi(high, green) %gmcp.char.maxstats.maxcon   %ansi(high, cyan)
                Hitroll: %ansi(high, green) }
#win stats {%ansi(high, cyan)Luck         : %ansi(high, green)%gmcp.char.stats.luck%ansi(high, white) /
            %ansi(high, green) %gmcp.char.maxstats.maxluck   %ansi(high, cyan)Damroll: %ansi(high, green)
            %gmcp.char.stats.dr }

#win stats {%cr%ansi(high, cyan)Exp To Level : %ansi(high, green)%gmcp.char.status.tnl        
               %ansi(high, cyan)Level    : %ansi(high, green)%gmcp.char.status.level}
#win stats {%ansi(high, cyan)Alignment    : %ansi(high, yellow)%gmcp.char.status.align       
            %ansi(high, cyan)Gold     : %ansi(high, yellow)}

#win stats {%cr%ansi(high, red)Fighting     : %gmcp.char.status.enemy%cr%ansi(high, green)E
            nemy Health : %gmcp.char.status.enemypct}

Sample output from this trigger is:

Disclaimer - there are probably better ways to present and format this data. For example, the formatting will completely break once someone with a different class or race uses it. The point of this trigger is to demonstrate how easy it is to get at the GMCP data. Someone else can make it pretty.

Advanced Version-The version below will update status, and keep formatting "pretty" no matter what stats you have/class/align/ ect.

advanced version