TinTin++ Mud Client Scripts  
space
space
This script provides three aliasses that allow you to maintain a list of muds as well as autologin capabilities. You must run initconnect each time you load the script. With addworld [ [password]] you can add a world to the list. With deleteworld you can remove a world from the list. With connect you'll connect to a world, if a character name and password has been given a character will automagically be logged in as well. The worlds are automatically saved to worlddata.tin and will be loaded when the script itself is read.

This script is written for v2.01.97 and higher

space
#EVENT {PROGRAM START}
{
     #class worlddata read worlddata.tin;
     #if {&{worldlist} == 0}
     {
          #class worlddata open;
          #list worldlist clear;
          #class worlddata close
     }
}

#ALIAS {addworld}
{
     #if {"%3" == ""}
     {
          #showme Syntax: addworld <name> <host> <port> [character name] [password]
     };
     #else
     {
          #variable worldlist[%1][name] %1;
          #variable worldlist[%1][host] %2;
          #variable worldlist[%1][port] %3;
          #if {"%4" != ""}
          {
               #variable worldlist[%1][char] %4
          };
          #if {"%5" != ""}
          {
               #variable worldlist[%1][pass] %5
          };
          #if {&worldlist[%1][char]}
          {
               #showme The world %1 (%2 %3) and the character %4 (%5) has been added.
          };
          #else
          {
               #showme The world %1 (%2 %3) has been added.
          };
          #class worlddata write worlddata.tin
     }
}

#ALIAS {deleteworld}
{
     #if {&worldlist[%1] != 0}
     {
          #unvariable worldlist[%1];
          #class worlddata write worlddata.tin;
          #showme The world %1 has been deleted.
     };
     #else
     {
          #showme The world %1 could not be found.
     }
}

#ALIAS {connect}
{
     #if {"%1" == ""}
     {
          #echo {%h} {{ WORLD LIST }};
          #foreach {$worldlist[]} {world}
          {
               #echo {%-20s %s %s %s} {$worldlist[$world][name]} {$worldlist[$world][host]} {$worldlist[$world][port]} {$worldlist[$world][char]}
          }
     };
     #elseif {&worldlist[%1] != 0}
     {
          #variable mud {%1};
          #session $worldlist[%1][name] $worldlist[%1][host] $worldlist[%1][port]
     };
     #else
     {
          #showme Could not find world %1.
     }
}

#EVENT {SESSION CONNECTED}
{
     #variable mud @gts{$mud};
     #if {&worldlist[$mud]}
     {
          #if {&worldlist[$mud][char]}
          {
               #send {$worldlist[$mud][char]};
               #if {&worldlist[$mud][pass]}
               {
                    #send {$worldlist[$mud][pass]}
               }
          }
     }
}