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

  1. //This area is for user configurable variables
  2.  
  3. str message_tone[]="y";
  4. str maintain_log[]="y";
  5. str phone_no_1200_baud[]="232-4546";
  6.  
  7. ///////////////////////////////////////////////////////////////////////////////
  8. //                                                                           //
  9. //                   pcp1200 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. main()
  23. {
  24.     int flag,
  25.         fp,
  26.         t;
  27.     str phone[20]="m",
  28.         usage_log_path[76],
  29.         buffer[12];
  30.  
  31.     clear_scr();
  32.     if(!carrier())
  33.     {
  34.         // Dail PCP at 1200 baud N82
  35.         strcat(phone,phone_no_1200_baud);
  36.         set_cparams(1200,0,8,2);
  37.         flag=dial(phone,0,1);
  38.         if(!flag)
  39.         {
  40.             status_wind("User aborted 1200 Baud Gateway to Pursuit!",30);
  41.             prints("+++ Gateway Aborted! +++");
  42.             beep(500);
  43.             hangup();
  44.             return;
  45.         }
  46.         ustamp("*** Connected to PC Pursuit at 1200 Baud.",1,1);
  47.     }
  48.     //Logon to PCP
  49.     status_wind("Logging on to Pursuit!",30);
  50.     prints("Logging on to Pursuit!");
  51.     cputs("^M");
  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.         t=curtime();
  84.         fputs("Logged on to PC Pursuit (1200 baud) on ",fp);
  85.         date(t,buffer);
  86.         fputs(buffer,fp);
  87.         fputs(" at ",fp);
  88.         time(t,buffer);
  89.         fputs(buffer,fp);
  90.         fputs(".",fp);
  91.         fputc(0x0d,fp);
  92.         fputc(0x0a,fp);
  93.         fclose(fp);
  94.     }
  95.     call("citydial.slc");
  96. }
  97.  
  98.  
  99.