GMCP in Aardwolf MUD using CMUD.

Clients.CmudGMCP History

Hide minor edits - Show changes to markup

September 15, 2010, at 02:15 AM EST by Hadar
Added lines 96-99:

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

advanced version

September 11, 2010, at 01:53 AM EST by admin
Changed lines 21-22 from:

CMUD - char.vitals.health trigger

to:

CMUD - room.info trigger


September 11, 2010, at 01:53 AM EST by admin
Changed lines 23-31 from:

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 char.vitals.health:

The full code for this trigger is:

to:

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

Added lines 25-54:
  1. PRINT GMCP.room: %gmcp.room
  2. PRINT GMCP.room.exits: %gmcp.room.info.exits
  3. PRINT GMCP.room.exits.n: %gmcp.room.info.exits.n
  4. PRINT Continent: %gmcp.room.info.coord.id
  5. PRINT -----------------------------------------------

@]

Which produces:

GMCP.room: 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"""
GMCP.room.exits: n=16543|s=16545|w=16541
GMCP.room.exits.n: 16543
Continent: 2

CMUD - char.vitals.health 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 char.vitals.health:

The full code for this trigger is:

[@

September 08, 2010, at 05:19 PM EST by admin
Changed lines 13-14 from:
to:


September 08, 2010, at 05:19 PM EST by admin
Deleted lines 16-25:

Example client triggers and scripts

CMUD Examples

CMUD - char.vitals.health 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 char.vitals.health:

Added lines 18-23:

CMUD - char.vitals.health 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 char.vitals.health:

Changed lines 25-26 from:
to:


September 08, 2010, at 05:07 PM EST by admin
Added lines 17-74:

Example client triggers and scripts

CMUD Examples

CMUD - char.vitals.health 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 char.vitals.health:

The full code for this trigger is:

execwin stats { #clr }
#win stats {%ansi(high, white) --------------- Stats for %gmcp.char.base.name -------------------%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)%gmcp.char.stats.int%ansi(high, 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)%gmcp.char.stats.hr }
#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)%gmcp.char.worth.gold}

#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.

September 08, 2010, at 05:04 PM EST by admin
Added lines 14-16:

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.

September 08, 2010, at 05:03 PM EST by admin
Added lines 1-13: