TinTin++ Mud Client Scripts  
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
space
space
This is an example script showing how to use the telnet event handler to interact with an MSDP capable server. MSDP is a data protocol to send out of bounds communication between a MUD server and a MUD client, and is specifically targeted at client side scripts. Similar protocols include ZMP, ATCP, and GMCP.

space
#format IAC  %a 255
#format DONT %a 254
#format DO   %a 253
#format WONT %a 252
#format WILL %a 251
#format SB   %a 250
#format SE   %a 240

#format MSDP %a  69

#format VAR  %a  01
#format VAL  %a  02

#var REPORTABLE_VARIABLES {{HEALTH};{HEALTH_MAX};{MANA};{MANA_MAX};{MOVE};{MOVE_MAX};{EXP_TNL};{EXP_TNL_MAX};{MONEY};{EXITS};{WORLD_TIME}}

#nop Turn telnet debug off once everything works as it's spammy.

#config {debug telnet} {on}

#event {IAC WILL MSDP}
{
        #send {$IAC$DO$MSDP\};
}

#event {IAC SB MSDP}
{
        #nop Save all variables with an MSDP_ prefix.

        #var {MSDP_%0} {%1}
}

#nop This event is generated at the end of an MSDP sub negotiation.

#event {IAC SB MSDP IAC SE}
{
        #nop
}

#nop Ask the server to report all keys inside REPORTABLE_VARIABLES

#alias {msdp_report}
{
        #var result {$IAC$SB$MSDP${VAR}REPORT};

        #foreach {$REPORTABLE_VARIABLES[]} {tmp}
        {
                #var result {$result${VAL}$tmp}
        };

        #send {$result$IAC$SE\}
}

#alias {msdp_list}
{
        #send {$IAC$SB$MSDP${VAR}LIST${VAL}%0$IAC$SE\}
}

#alias {msdp_send}
{
        #send {$IAC$SB$MSDP${VAR}SEND${VAL}%0$IAC$SE\}
}