TinTin++ Mud Client Scripts  
space
space
This script will enable a promptbar and automapping for any MSDP enabled MUD supporting the ROOM, HEALTH, MANA, MOVEMENT, EXPERIENCE, MONEY, and ROOM_EXITS variables. You can test this script on Lowlands (lolamud.net 6969).

This script is written for v2.01.97 and higher

space
#EVENT {SESSION CONNECTED}
{
	#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 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;
	#variable {MSDP_REPORTABLE_VARIABLES}{{ROOM};{ROOM_EXITS};{ALIGNMENT};{EXPERIENCE};{EXPERIENCE_MAX};{HEALTH};{HEALTH_MAX};{LEVEL};{MANA};{MANA_MAX};{MONEY};{MOVEMENT};{MOVEMENT_MAX};{ROOM_EXITS};};
	#nop Turn telnet debug on if there are problems.;
	#config {debug telnet} {off};
	#split 16 1;
	#map create 100000;
	#map flag nofollow;
	#map flag vtmap;
	#map flag static;
	#map read msdp.map
}


#EVENT {SESSION DISCONNECTED}
{
	#map write msdp.map
}


#VARIABLE {DIR_NAME}
{
	{d} {D}
	{down} {D}
	{e} {E}
	{east} {E}
	{n} {N}
	{north} {N}
	{s} {S}
	{south} {S}
	{u} {U}
	{up} {U}
	{w} {W}
	{west} {W}
}

#FUNCTION {colscale}
{
	#switch {%0}
	{
		#case {0}
		{
			#return <faa>
		};
		#case {1}
		{
			#return <fba>
		};
		#case {2}
		{
			#return <fca>
		};
		#case {3}
		{
			#return <fda>
		};
		#case {4}
		{
			#return <fea>
		};
		#case {5}
		{
			#return <ffa>
		};
		#case {6}
		{
			#return <efa>
		};
		#case {7}
		{
			#return <dfa>
		};
		#case {8}
		{
			#return <cfa>
		};
		#case {9}
		{
			#return <bfa>
		};
		#default
		{
			#return <afa>
		}
	}
}


#EVENT {IAC WILL MSDP}
{
	#send {$TELNET[IAC]$TELNET[DO]$TELNET[MSDP]\};
	msdp_report
}


#EVENT {IAC SB MSDP}
{
	#nop Save all variables with an MSDP_ prefix.;
	#variable {MSDP_%0} {%1}
}


#EVENT {IAC SB MSDP IAC SE}
{
	#if {&MSDP_ROOM_EXITS == 0}
	{
		#return
	};
	#format {prompt} {};
	#format {prompt} {$prompt<038> Hp: @colscale{$MSDP_HEALTH;$MSDP_HEALTH_MAX}%+4s<238>/<138>%-4s } {$MSDP_HEALTH} {$MSDP_HEALTH_MAX};
	#format {prompt} {$prompt<238> Mn: @colscale{$MSDP_MANA;$MSDP_MANA_MAX}%+4s<238>/<138>%-4s } {$MSDP_MANA} {$MSDP_MANA_MAX};
	#format {prompt} {$prompt<238> Mv: @colscale{$MSDP_MOVEMENT;$MSDP_MOVEMENT_MAX}%+4s<238>/<138>%-4s } {$MSDP_MOVEMENT} {$MSDP_MOVEMENT_MAX};
	#format {prompt} {$prompt<238> Xp: @colscale{$MSDP_EXPERIENCE;$MSDP_EXPERIENCE_MAX}%-3m } {100 * $MSDP_EXPERIENCE / $MSDP_EXPERIENCE_MAX};
	#format {prompt} {$prompt<238> Gd: %-8s } {$MSDP_MONEY};
	#variable exits {};
	#foreach {n;north;e;east;s;south;w;west;u;up;d;down} {exit}
	{
		#if {&MSDP_ROOM_EXITS[$exit] == 0}
		{
			#continue
		};
		#if {"$MSDP_ROOM_EXITS[$exit]" == "{O|OPEN}"}
		{
			#variable {exits} {$exits<138>$DIR_NAME[$exit]}
		};
		#else
		{
			#variable {exits} {$exits<168>$DIR_NAME[$exit]}
		}
	};
	#format {prompt} {$prompt <238>Ex: %-6s} {$exits   <088>};
	#line ignore #showme {$prompt} {1}
}


#EVENT {IAC SB MSDP ROOM}
{
	#variable {MSDP_ROOM} {%1};
	#map goto {$MSDP_ROOM[VNUM]} {dig};
	#map set roomarea $MSDP_ROOM[AREA];
	#map set roomname $MSDP_ROOM[NAME];
	#map set roomterrain $MSDP_ROOM[TERRAIN];
	#map set roomcolor <178>;
	#nop Create unmapped exits and color unexplored rooms red.;
	#foreach {$MSDP_ROOM[EXITS][]} {EXIT}
	{
		#map get {roomexit} {EXIT_LIST};
		#if {&EXIT_LIST[$EXIT] == 0}
		{
			#map get {roomvnum} {EXIT_VNUM} {$MSDP_ROOM[EXITS][$EXIT]};
			#map dig {$EXIT} {$MSDP_ROOM[EXITS][$EXIT]};
			#if {$EXIT_VNUM == 0}
			{
				#map set {roomcolor} {<118>} {$MSDP_ROOM[EXITS][$EXIT]}
			}
		}
	}
}


#ALIAS {msdp_report}
{
	#nop Ask the server to report all keys inside REPORTABLE_VARIABLES;
	#variable result {$TELNET[IAC]$TELNET[SB]$TELNET[MSDP]$MSDP[VAR]REPORT};
	#foreach {*MSDP_REPORTABLE_VARIABLES[]} {tmp}
	{
		#variable result {$result$MSDP[VAL]$tmp}
	};
	#send {$result$TELNET[IAC]$TELNET[SE]\}
}
{5}


#ALIAS {msdp_list}
{
	#send {$TELNET[IAC]$TELNET[SB]$TELNET[MSDP]$MSDP[VAR]LIST$MSDP[VAL]%0$TELNET[IAC]$TELNET[SE]\}
}
{5}


#ALIAS {msdp_send}
{
	#send {$TELNET[IAC]$TELNET[SB]$TELNET[MSDP]$MSDP[VAR]SEND$MSDP[VAL]%0$TELNET[IAC]$TELNET[SE]\}
}
{5}


#ALIAS {example}
{
	msdp_list COMMANDS;
	msdp_list REPORTABLE_VARIABLES;
	msdp_report
}
{5}