home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / telix / tlxpcp15.arc / PCP2400.SLT < prev    next >
Text File  |  1989-01-06  |  3KB  |  100 lines

  1. //This area is for user configurable variables
  2.  
  3. str message_tone[]="y";
  4. str maintain_log[]="y";
  5. str phone_no_2400_baud[]="232-9513";
  6.  
  7. ///////////////////////////////////////////////////////////////////////////////
  8. //                                                                           //
  9. //               pcp2400 v1.5 Copyright (c) by Charles Lee                   //
  10. //                        January 1989                                       //
  11. //                                                                           //
  12. ///////////////////////////////////////////////////////////////////////////////
  13.  
  14. beep(int freq)
  15. {
  16.     if((message_tone=="y")|(message_tone=="Y"))
  17.     {
  18.         tone(freq,20);
  19.     }
  20. }
  21.  
  22.  
  23. main()
  24. {
  25.     int flag,
  26.         fp,
  27.         t;
  28.     str phone[20]="m",
  29.         usage_log_path[76],
  30.         buffer[12];
  31.  
  32.     if(!carrier())
  33.     {
  34.         // Dail PCP at 2400 baud N82
  35.         strcat(phone,phone_no_2400_baud);
  36.         set_cparams(2400,0,8,2);
  37.         flag=dial(phone,0,1);
  38.         if(!flag)
  39.         {
  40.             status_wind("User aborted 2400 Baud Gateway to Pursuit!",30);
  41.             prints("+++ Gateway Aborted! +++");
  42.             beep(500);
  43.             hangup();
  44.             return;
  45.         }
  46.         ustamp("*** Connected to PC Pursuit at 2400 Baud.",1,1);
  47.     }
  48.     //Logon to PCP
  49.     status_wind("Logging on to Pursuit!",30);
  50.     prints("Logging on to Pursuit!");
  51.     cputs("@");
  52.     delay(10);
  53.     cputs("D^M");
  54.     flag=waitfor("=",5);
  55.     if(!flag)
  56.     {
  57.         status_wind("Unable to log on to Pursuit!");
  58.         prints("+++ Unable to log on! +++");
  59.         beep(500);
  60.         hangup();
  61.         return;
  62.     }
  63.     else
  64.     {
  65.         cputs("D1^M");
  66.     }
  67.  
  68.  
  69.     //Successful Logon!
  70.     beep(3000);
  71.     status_wind("Success!",30);
  72.     if((maintain_log=="y")|(maintain_log=="Y"))
  73.     {
  74.         status_wind("Updating usage log!",30);
  75.         usage_log_path=_script_dir;
  76.         strcat(usage_log_path,"usage.pcp");
  77.         fp=fopen(usage_log_path,"a+");
  78.         for(flag=4;flag;flag=flag-1)
  79.         {
  80.             fputc(0x0d,fp);
  81.             fputc(0x0a,fp);
  82.         }
  83.  
  84.         t=curtime();
  85.         fputs("Logged on to PC Pursuit (2400 baud) on ",fp);
  86.         date(t,buffer);
  87.         fputs(buffer,fp);
  88.         fputs(" at ",fp);
  89.         time(t,buffer);
  90.         fputs(buffer,fp);
  91.         fputs(".",fp);
  92.         fputc(0x0d,fp);
  93.         fputc(0x0a,fp);
  94.         fclose(fp);
  95.     }
  96.     call("citydial.slc");
  97. }
  98.  
  99.  
  100.