TinTin++ Mud Client Scripts
This script works with TinTin++ 2.02.62. 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.

This script is written for v2.01.97 and higher

#EVENT {SESSION CONNECTED}
{
    #variable REPORTABLE_VARIABLES {HEALTH;HEALTH_MAX;MANA;MANA_MAX;MOVEMENT;MOVEMENT_MAX;EXPERIENCE_TNL;EXPERIENCE_TNL_MAX;MONEY;ROOM_EXITS;WORLD_TIME};
    #nop Turn telnet debug off once everything works.;
    #config {debug telnet} {on}
}

#EVENT {IAC WILL MSDP}
{
    #line oneshot #FORMAT {IAC_DO_MSDP} {%a%a%a} {255} {253} {69};
    #send {$IAC_DO_MSDP\}
}

#EVENT {IAC SB MSDP}
{
    #nop Save all variables in the MSDP table.;
    #variable {MSDP[%0]} {%1}
}

#ALIAS {msdp_report}
{
    #nop Ask the server to report all keys inside REPORTABLE_VARIABLES;
    #line msdp #send {REPORT}{$REPORTABLE_VARIABLES}\
}

#ALIAS {msdp_list}
{
    #line msdp #send {LIST}{%0}\
}

#ALIAS {msdp_send}
{
    #line msdp #send {SEND}{%0}\
}

#ALIAS {example}
{
    #nop msdp commands are case sensitive, so they must be upper case msdp_list COMMANDS;
    msdp_list REPORTABLE_VARIABLES;
    msdp_report;
    msdp_send $REPORTABLE_VARIABLES;
    #delay 1 #var MSDP;
    #delay 1 #showme HEALTH: $MSDP[HEALTH] HEALTH_MAX: $MSDP[HEALTH_MAX]
}