        This document will take you through the process of enhancing your
logon salt script created with Slearn to add the additional functions as
described in the ?.fnc and ?.txt files included in this archive.  The starting
point is this SALT script as created by SLEARN for to access the deltaComm
BBS.

December 18, 1992
        This is my second release of these files.  I found that with the
release of Telix 3.20, the Autoz.Slt included in the first package,
AutoSalt.Lzh, is no longer needed.
                                        Keith Williams

//
//  This is the starting point, a logon Salt script created by SLEARN
//
//  Automatic SALT logon script for Firebarn BBS
//
//  Created by -- SLEARN  (SALT learn utility)  v1.10
//             -- Copyright (C) 1990 Paul Roub.  All rights reserved.
//  Created on -- Sun Aug 30, 1992 at 1:15am
//


// used by showname():
//
int       statline =  24;                     // Telix status line row
int       statback =   4;                     // status line background color
int       statfore =  14;                     // status line foreground color


str       failed[] = "Logon failed.";


//  main routine
//
main()
{
  alarm(1);
  showname();

  if (! waitfor("o change?", 60)) 
  {
    prints(failed);
    return;
  }
  delay(2);
  cputs("^M");

  if (! waitfor("nter)=no?", 60))
  {
    prints(failed);
    return;
  }
  delay(2);
  cputs("^M");

  if (! waitfor("irst name ?", 60))
  {
    prints(failed);
    return;
  }
  delay(2);
  cputs("Firstname^M");                 // Use your own first name,

  if (! waitfor("ast name  ?", 60))
  {
    prints(failed);
    return;
  }
  delay(2);
  cputs("Lastname^M");                  // And last name.

  if (! waitfor("ll echo)?", 60))
  {
    prints(failed);
    return;
  }
  delay(2);
  cputs(_entry_pass);
  cputc('^M');

  return;
}


//  Function:     showname
//  Description:  Displays the name of the system you're connected to, or
//                "Alt-Z for Help" if you're not connected to anything.
//
//                You can plug this into ANY logon script file, just call it
//                as shown in main().
//
//                This routine will overwrite the "Alt-Z for Help" message,
//                but I think it's worth it.  If you don't like this feature,
//                set the Anonymous option in SLCONFIG to 'y' (YES).
//  Parameters:   none
//  Returns:      nothing
//
showname()
{
  str       name[14];                         // name to display
  int       x, y;                             // old cursor position

  x = getx();                                 // save current position
  y = gety();                                 //

  substr(_entry_name, 0, 14, name);           // get the current BBS name
  if ((strlen(name) == 0) || (! carrier()))   // no name or not connected?
    name = "Alt-Z for Help";                  //   then display help message

  strcat(name, "              ");             // pad name with spaces

  pstraxy( name, 1, statline,                 // display it
           (statback * 16) + statfore
         );

  gotoxy(x, y);                               // return to saved position
}

        NOW TO ADD THE OTHER ENHANCEMENTS TO MY LOGON SCRIPT!!

        1. First of all I delete everything except the actual logon
        section of the SALT.  All that remains (with some extra spaces
        removed) is the following:

  if (! waitfor("o change?", 60)) 
  { prints(failed); return; }
  delay(2); cputs("^M");

  if (! waitfor("nter)=no?", 60))
  { prints(failed); return; }
  delay(2); cputs("^M");

  if (! waitfor("irst name ?", 60))
  { prints(failed); return; }
  delay(2); cputs("Firstname^M");

  if (! waitfor("ast name  ?", 60))
  { prints(failed); return; }
  delay(2); cputs("Lastname^M");

  if (! waitfor("ll echo)?", 60))
  { prints(failed); return; }
  delay(2); cputs(_entry_pass); cputc('^M');


        2. Now I change every occurance of "return;" to "goto quit;" so
        that if the logon does fail I can turn off my additional functions
        before exiting the script.  This done, I exit my editor, saving the
        file as logon.txt.
           My remaining text now reads:

  if (! waitfor("o change?", 60)) 
  { prints(failed); goto quit; }
  delay(2); cputs("^M");

  if (! waitfor("nter)=no?", 60))
  { prints(failed); goto quit; }
  delay(2); cputs("^M");

  if (! waitfor("irst name ?", 60))
  { prints(failed); goto quit; }
  delay(2); cputs("Firstname^M");

  if (! waitfor("ast name  ?", 60))
  { prints(failed); goto quit; }
  delay(2); cputs("Lastname^M");

  if (! waitfor("ll echo)?", 60))
  { prints(failed); goto quit; }
  delay(2); cputs(_entry_pass); cputc('^M');


        3. Now from the dos prompt I enter:
                copy newlogon.txt + logon.txt + runlogon.txt logon.slt
                ren logon.slt deltabbs.slt
           the resulting DeltaBBS.Slt is as follows:

int statline = 24; int statback = 4; int statfore = 14;
str failed[]    = "Logon failed.";
main()
{
  autocap(); alarm(1); showname();

  if (! waitfor("o change?", 60)) 
  { prints(failed); goto quit; }
  delay(2); cputs("^M");

  if (! waitfor("nter)=no?", 60))
  { prints(failed); goto quit; }
  delay(2); cputs("^M");

  if (! waitfor("irst name ?", 60))
  { prints(failed); goto quit; }
  delay(2); cputs("Firstname^M");

  if (! waitfor("ast name  ?", 60))
  { prints(failed); goto quit; }
  delay(2); cputs("Lastname^M");

  if (! waitfor("ll echo)?", 60))
  { prints(failed); goto quit; }
  delay(2); cputs(_entry_pass); cputc('^M');

  capture ("*PAUSE*");
//
//      This is where the first release called the autoz function, no longer
//      necessary, but I still want the rest of my online session to continue
//      before I exit this script.  So,...
  while (carrier())              // Continue as long as you are online.
    {
        terminal();
    }

  quit: capture ("*CLOSE*"); update_term();
}
showname()
{
  str name[14]; int x, y; x = getx(); y = gety();
  substr(_entry_name, 0, 14, name);
  if ((strlen(name) == 0) || ( ! carrier())) name = "Alt-Z for Help";
  strcat(name, "              ");
  pstraxy( name, 1, statline, (statback * 16) + statfore); gotoxy(x, y);
}
autocap()
{
  str datebuf[16]; str timebuf[16]; str dialbuf[14];
  date (curtime(), datebuf); time (curtime(), timebuf);
  str capfile[25] = "C:\TELIX\CAP\";
  copystr (_entry_name, capfile, 13, 8);
  str capext[4]   = ".CAP";
  copystr (capext, capfile, 21, 4);
  capture (capfile);
  prints ("");
  prints (":TELIX 3.20:");
  printsc ("   Logged on to "); printsc (_entry_name); printsc (" @ "); printsc (_entry_num);
  printsc (" on "); printsc (datebuf); printsc (" at "); prints (timebuf);
  printsc ("         Capture in "); prints (capfile);
  prints ("::");
} 

        4. Compile the SALT script with CS.EXE and it's ready for me to
        use to logon to The deltaComm BBS!
