home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / c / cn311-sw.zip / TELIX.SLT < prev    next >
Text File  |  1990-12-21  |  7KB  |  225 lines

  1. // ----------------------------------------------------------------------- //
  2. //       **** Begin CircuitNET Mail Run Script Configuration ****          //
  3. // ----------------------------------------------------------------------- //
  4. // 
  5. // Enter your 6 digit Node ID between the quotes on the next line
  6.  
  7. str  nodeid[6] = "000000";
  8.  
  9. // Enter the outgoing packet name between the quotes on the next line 
  10.  
  11. str  buf[], ufilename[] = "C:\CIRCUIT\MAIL\000000.ZIP";
  12.  
  13. // Enter the path of where to download the mail packet between the quotes
  14. // on the next line.  Be sure to end with a backslash.
  15.  
  16. str  newdlpath[]  = "C:\CIRCUIT\MAIL\";
  17.  
  18. // Enter the 6 digits for your birthdate below.  If the month or day is a single
  19. // digit, preceed it with a zero.  DON'T enter any / or -, 6 digits only!
  20.  
  21. str  birthdate[6]  = "000000";
  22.  
  23. // Enter the baud to reset modem to after host hangup after the = mark 
  24. // on the next line.
  25.  
  26. int  reset_baud   = 00000;
  27.  
  28. // If you wish to capture your mail run for debugging purposes enter the dirctory
  29. // and name of the capture file between the quotes on the next line.
  30.  
  31. str capfilename[] = "C:\TELIX\CAMAIL.CAP";
  32.  
  33. // Don't enter anything for this next one. 
  34. str  dfilename[];       
  35. // This one holds the current download directory.  Don't enter anything.
  36. str holddowndir[80];    
  37.  
  38. // Make sure to put your password in the Telix dialing directory
  39. // Now save this file and compile it using the CS.EXE utility that comes 
  40. // with Telix.  Type CS <script file name>.slt
  41. // ----------------------------------------------------------------------- //
  42. //            **** End CircuitNET Mail Run Script Configuration ****       //
  43. // ----------------------------------------------------------------------- //
  44.  
  45. main()
  46. {
  47.  
  48.  holddowndir = _down_dir;
  49.  _down_dir   = newdlpath;
  50.  
  51.  
  52.  strcat(dfilename, newdlpath);                   // Start with download directory
  53.  strcat(dfilename, nodeid);                      // Add NodeId
  54.  strcat(dfilename, ".ZIP");                      // Add .ZIP file extention
  55.  
  56.  clear_scr();
  57.    
  58.    int cst;
  59.    cst = capture_stat ();                        // check capture status
  60.    
  61.    if (cst == 1)                                 // close capture if open
  62.     {
  63.      capture("*CLOSE*");
  64.     }
  65.  capture(capfilename);
  66.  
  67.  int stat, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12;
  68.  int tmark = 0;
  69.  t1 = track("continue? ", 1);
  70.  t2 = track("?]? ", 1);
  71.  t3 = track("[Y/n] ", 1);
  72.  t4 = track("Menu? ", 1);
  73.  t5 = track("[y/N]? ", 1);
  74.  t6 = track("[MM-DD-YY]", 1);        // watch for birthdate prompt
  75.  t7 = track("irst name: ", 1);       // first name prompt
  76.  t8 = track("last name: ", 1);       // last name prompt
  77.  t9 = track(" password: ", 1);       // password prompt
  78.  t10 = track("<R>e-Enter ", 1);      // whoops, entered name wrong, try again
  79.  t11 = track("SELECTION ", 1);       // SFMSGST no we don't want to scan
  80.  t12 = track("ENTER COMMAND ", 1);   // the good stuff, send/receive mail
  81.  tmark = timer_start(1800);          // wait up to 3 minute for upload prompt
  82.  
  83.  while (carrier())
  84.   {
  85.    terminal();
  86.    stat = track_hit(0);
  87.    if (stat == t1)
  88.      cputs("^M");
  89.    if (stat == t12)     
  90.     {
  91.       cputs("A^M");
  92.       ustamp( "** Sent A Command **", 1, 1 );
  93.       Delay(10);
  94.       receive('Z', dfilename);
  95.       ustamp( "** Received Inbound Mail Packet **", 1, 1 );
  96.       if(filefind(ufilename, 0, buf) !=0)
  97.         {
  98.          Terminal();
  99.          ustamp( "** Found Outbound Mail Packet **", 1, 1 );
  100.          While(carrier())
  101.           {
  102.            Terminal();
  103.            ustamp( "** Waiting to send upload signal **", 1, 1 );
  104.            timer_restart(tmark, 600);       // wait up to 1 minute to send upload command
  105.            stat = track_hit(0);
  106.            if (stat == t12 or time_up(tmark))
  107.             {
  108.              delay(20);   
  109.              cputs("B^M");
  110.              ustamp( "** Sent B Command **", 1, 1 );
  111.              Delay(15);
  112.              send('Z', ufilename);
  113.              track_free(t3);  
  114.              track_free(t3);  
  115.              timer_free(tmark);
  116.              timer_free(tmark);
  117.              ustamp( "** Sent Outbound Mail Packet **", 1, 1 );
  118.              Break;
  119.             }
  120.           }
  121.         }  
  122.       else
  123.         {
  124.          status_wind("No Outgoing Mail packet!", 30);
  125.          ustamp( "** No Outgoing Mail packet **", 1, 1 );
  126.         }   
  127.       track_free(t3);  
  128.       timer_free(tmark);
  129.       status_wind("Mailpack proceedures done.  Logging off!", 20);
  130.       delay(20);
  131.       cputs("G^M");
  132.       delay(10);
  133.       cputs("Y^M");
  134.       ustamp( "** Sent logoff commands **", 1, 1 );
  135.       Break;
  136.     }
  137.    if (stat == t3)
  138.      cputs("N^M");
  139.    if (stat == t4)
  140.      cputs("^M");
  141.    if (stat == t5)
  142.       cputs("N^M");
  143.    if (stat == t6)                
  144.       {
  145.       delay(5);
  146.       cputs(birthdate);           // tell them when we were born, no fibbing 
  147.       cputs("^M");
  148.       }
  149.    if (stat == t7)
  150.       {
  151.       cputs(nodeid);              // send user name as node id
  152.       cputs("^M");
  153.       }
  154.    if (stat == t8)
  155.       cputs("^M");
  156.    if (stat == t9)
  157.       {
  158.        cputs(_entry_pass);
  159.        cputs("^M");
  160.       }
  161.    if (stat == t10)
  162.       cputs("R^M");
  163.    if (stat == t11)
  164.       cputs("S^M");
  165.    }
  166.  
  167.   track_free(0);                  // Clear all track channels
  168.   terminal();                     // Give terminal a time slice
  169.   capture( "*CLOSE*" );           // Close our capture file
  170.   _down_dir = holddowndir;        // Put default down dir back
  171.   
  172.   
  173.   off_line();
  174. }
  175. // ------------------------------------------------------------------------- //
  176.  
  177. off_line()
  178.  {
  179.    status_wind("Waiting for 'NO CARRIER'...", 20);
  180.  
  181.    waitfor("NO CARRIER", 5);
  182.     terminal();
  183.     if (carrier())  hangup();
  184.  
  185.    delay(5);
  186.  
  187.    set_cparams(reset_baud, get_parity(), get_datab(), get_stopb());
  188.  
  189.    cputs_tr("AT^M");           // get modem attention
  190.    waitfor("OK", 5);
  191.     terminal();
  192.     delay(5);
  193.     terminal();
  194.  
  195.    cputs_tr("ATZ^M");          // reset modem to CMOS defaults
  196.    waitfor("OK", 5);
  197.     terminal();
  198.     delay(5);
  199.     terminal();
  200.  
  201.    cputs_tr("ATZ^M");          // Do it again -- in case RING came in...
  202.    waitfor("OK", 5);
  203.     terminal();
  204.     delay(5);
  205.  
  206.    cputs_tr("ATH1^M");         // Go off-hook
  207.    waitfor("OK", 3);
  208.     terminal();
  209.     delay(5);
  210.  
  211.    cputs_tr("ATH1^M");         // Again -- just in case a RING came in...
  212.    waitfor("OK", 3);
  213.     terminal();
  214.     terminal();
  215.  
  216.    status_wind("Line should now be off-hook.", 10);
  217.  
  218.    ustamp( "*************************************************", 1, 1 );
  219.    exittelix(0);               // Unload Telix, return to batch w/Errorlevel=0
  220.  }
  221.  
  222.  
  223. // ------------------------------------------------------------------------- //
  224.  
  225.