home *** CD-ROM | disk | FTP | other *** search
/ BlastDOS / Telix.rar / Telix / PCBOARD.SLT < prev    next >
Text File  |  1992-01-09  |  2KB  |  79 lines

  1. /////////////////////////////  PCBOARD.SLT  //////////////////////////////////
  2.  
  3. // This is a sample script for logging on to a PCBoard based system.
  4. // The logon questions are handled in any order, and optional prompts are ok.
  5.  
  6. str user_name[] = "John Smith";
  7.  
  8. // Put your name in the above line. The script will get the proper password
  9. // from the dialing directory (Telix puts that password in the script system
  10. // variable called _entry_pass).
  11.  
  12. // Before using this script for the first time, or when you make a change,
  13. // type 'cs pcboard' at the DOS prompt to compile the script for use by Telix.
  14.  
  15. //////////////////////////////////////////////////////////////////////////////
  16.  
  17. main()
  18.  
  19. {
  20.  int stat;
  21.  int t1,
  22.      t2,
  23.      t3,
  24.      t4;
  25.  int tmark;
  26.  
  27.  alarm (1);
  28.  
  29.  if (not _entry_pass)                     // no pass, so didn't recog. board
  30.   {
  31.    prints ("Sorry, I don't know the password for this BBS!");
  32.    return;
  33.   }
  34.  
  35.  t1 = track (" graphics", 1);
  36.  t2 = track ("first name?", 1);
  37.  t3 = track ("Password", 1);
  38.  t4 = track ("Language # to use", 1);
  39.  
  40.  tmark = timer_start (1800);            // wait up to 3 minutes for login
  41.  
  42.                                         // answer any logon questions
  43.  while (not time_up (tmark))
  44.   {
  45.    terminal();                          // let Telix process any chars and keys
  46.  
  47.    stat = track_hit (0);                // see which (if any) track was hit
  48.  
  49.    if (stat == t1)                      // say whether we want graphics
  50.     {
  51.      delay (5);
  52.      cputs ("y q^M");
  53.     }
  54.    else if (stat == t2)                 // send name
  55.     {
  56.      cputs (user_name);
  57.      cputs ("^M");
  58.     }
  59.    else if (stat == t3)                 // send password
  60.     {
  61.      cputs (_entry_pass);
  62.      cputs ("^M");
  63.      break;                             // done with logon
  64.     }
  65.    else if (stat == t4)                 // specific to CRS
  66.     {
  67.      delay (5);
  68.      cputs ("^M");
  69.     }
  70.   }
  71.  
  72.  if (time_up (tmark))
  73.   prints ("Logon failed!");
  74.  
  75.  timer_free (tmark);                    // free timer channel
  76.  track_free (0);                        // and all track channels
  77.                
  78. }              
  79.