TinTin++ Mud Client Scripts  
space
space
Arachnos is an Intermud standard utilizing MSDP. See: Arachnos Intermud Network for more information.

This script is written for v2.01.92 and higher

space
#EVENT {IAC WILL MSDP}
{
     #send {$TELNET[IAC]$TELNET[DO]$TELNET[MSDP]\};
     #nop Should be a persistent 31 bit random number, but for testing this will work;
     #send {$TELNET[IAC]$TELNET[SB]$TELNET[MSDP]$MSDP[VAR]ARACHNOS_ID$MSDP[VAL]123456789$TELNET[IAC]$TELNET[SE]\};
     #send {$TELNET[IAC]$TELNET[SB]$TELNET[MSDP]$MSDP[VAR]REPORT$MSDP[VAL]ARACHNOS_DEVEL$MSDP[VAL]ARACHNOS_CHAT$TELNET[IAC]$TELNET[SE]\}
}

#EVENT {IAC WILL MSSP}
{
     update_mudlist
}

#EVENT {IAC SB MSSP NAME}
{
     #variable MUD_NAME %1
}

#EVENT {IAC SB MSSP PLAYERS}
{
     #variable MUD_PLAYERS %1
}

#EVENT {IAC SB MSSP UPTIME}
{
     #variable MUD_UPTIME %1
}

#EVENT {SESSION CONNECTED}
{
     #config {telnet} {debug};
     #variable MUD_NAME %0;
     #variable MUD_HOST %1;
     #variable MUD_PORT %3;
     #variable CONNECT_RETRY 0 #variable TELNET[IAC]  \xFF;
     #variable TELNET[DONT] \xFE;
     #variable TELNET[DO]   \xFD;
     #variable TELNET[WONT] \xFC;
     #variable TELNET[WILL] \xFB;
     #variable TELNET[SB]   \xFA;
     #variable TELNET[SE]   \xF0;
     #variable TELNET[MSDP] \x45;
     #variable TELNET[MSSP] \x46;
     #variable MSDP[VAR]   \x01;
     #variable MSDP[VAL]   \x02;
     #variable MSDP[TABLE_OPEN]  \x03;
     #variable MSDP[TABLE_CLOSE] \x04;
     #variable MSDP[ARRAY_OPEN]  \x05;
     #variable MSDP[ARRAY_CLOSE] \x06
}

#EVENT {SESSION DISCONNECTED}
{
     #math CONNECT_RETRY $CONNECT_RETRY + 1;
     #if {$CONNECT_RETRY < 10}
     {
          #gts #delay {10 * $CONNECT_RETRY} #session {%0} {%1} {%3}
     }
}

#EVENT {IAC SB MSDP ARACHNOS_DEVEL}
{
     #variable {DEVEL} {%1};
     #showme <118>[DEVEL DEBUG] $DEVEL[MSG_USER] : $DEVEL[MSG_BODY];
     #format time_stamp %T;
     #variable result {};
     #variable result $result$MSDP[VAR]MUD_NAME$MSDP[VAL]$MUD_NAME;
     #variable result $result$MSDP[VAR]MUD_HOST$MSDP[VAL]$MUD_HOST;
     #variable result $result$MSDP[VAR]MUD_PORT$MSDP[VAL]$MUD_PORT;
     #variable result $result$MSDP[VAR]MSG_TIME$MSDP[VAL]$time_stamp;
     #variable result $result$MSDP[VAR]MSG_USER$MSDP[VAL]$DEVEL[MSG_USER];
     #variable result $result$MSDP[VAR]MSG_BODY$MSDP[VAL]$DEVEL[MSG_BODY];
     #send {$TELNET[IAC]$TELNET[SB]$TELNET[MSDP]$MSDP[VAR]ARACHNOS_DEVEL$MSDP[VAL]$MSDP[TABLE_OPEN]$result$MSDP[TABLE_CLOSE]$TELNET[IAC]$TELNET[SE]\}
}

#EVENT {IAC SB MSDP ARACHNOS_CHAT}
{
     #variable {CHAT} {%1};
     #showme <118>[CHAT DEBUG] $CHAT[MSG_USER] : $CHAT[MSG_BODY];
     #format time_stamp %T;
     #variable result {};
     #variable result $result$MSDP[VAR]MUD_NAME$MSDP[VAL]$MUD_NAME;
     #variable result $result$MSDP[VAR]MUD_HOST$MSDP[VAL]$MUD_HOST;
     #variable result $result$MSDP[VAR]MUD_PORT$MSDP[VAL]$MUD_PORT;
     #variable result $result$MSDP[VAR]MSG_TIME$MSDP[VAL]$time_stamp;
     #variable result $result$MSDP[VAR]MSG_USER$MSDP[VAL]$CHAT[MSG_USER];
     #variable result $result$MSDP[VAR]MSG_BODY$MSDP[VAL]$CHAT[MSG_BODY];
     #send {$TELNET[IAC]$TELNET[SB]$TELNET[MSDP]$MSDP[VAR]ARACHNOS_CHAT$MSDP[VAL]$MSDP[TABLE_OPEN]$result$MSDP[TABLE_CLOSE]$TELNET[IAC]$TELNET[SE]\}
}

#ALIAS {update_mudlist}
{
     #send {$TELNET[IAC]$TELNET[DO]$MSSP\};
     #delay {12}{update_mudlist_delayed};
     #delay {update_mudlist} {update_mudlist} {30:00}
}

#ALIAS {update_mudlist_delayed}
{
     #if {&MUD_UPTIME}
     {
          #format time_stamp %T;
          #variable result {};
          #variable result $result$MSDP[VAR]MUD_NAME$MSDP[VAL]$MUD_NAME;
          #variable result $result$MSDP[VAR]MUD_HOST$MSDP[VAL]$MUD_HOST;
          #variable result $result$MSDP[VAR]MUD_PORT$MSDP[VAL]$MUD_PORT;
          #variable result $result$MSDP[VAR]MUD_UPTIME$MSDP[VAL]$MUD_UPTIME;
          #variable result $result$MSDP[VAR]MUD_UPDATE$MSDP[VAL]$time_stamp;
          #variable result $result$MSDP[VAR]MUD_PLAYERS$MSDP[VAL]$MUD_PLAYERS;
          #all #send {$TELNET[IAC]$TELNET[SB]$TELNET[MSDP]$MSDP[VAR]ARACHNOS_MUDLIST$MSDP[VAL]$MSDP[TABLE_OPEN]$result$MSDP[TABLE_CLOSE]$TELNET[IAC]$TELNET[SE]\}
     }
}