home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0090 - 0099 / ibm0090-0099 / ibm0099.tar / ibm0099 / WINCIMP1.ZIP / SCRIPTS.LIB / CSC.SCR < prev    next >
Encoding:
Text File  |  1992-04-02  |  2.4 KB  |  81 lines

  1. !---------------------------------------------------------------------!
  2. !                                                                     !
  3. !  Copyright (c) 1991                                                 !  
  4. !  by CompuServe Incorporated, Columbus, Ohio                         !
  5. !                                                                     !
  6. !  The information in this software is subject to change without      !
  7. !  notice and should not be construed as a commitment by CompuServe.  !
  8. !                                                                     !
  9. !  InfoNet Script:                                                    !
  10. !     Connect to InfoNet or InfoNet-Europe.  Arg1 contains TRUE if    !
  11. !     connect is to InfoNet-Europe and FALSE otherwise.               !
  12. !     Success:  returns %Success                                      !
  13. !     Failure:  saves error msg in %FailureMsg and returns %Failure   !
  14. !                                                                     !
  15. !     $Revision::   1.4         $                                     !
  16. !                                                                     !
  17. !---------------------------------------------------------------------!
  18.  
  19. show "Connecting to InfoNet";
  20. Tries = 5;
  21.  
  22. Europe = Arg1;
  23. Timeout = 10;
  24. Got_Center = %FALSE;
  25. on cancel goto Return_Cancel;
  26. FailStr = "InfoNet not responding";
  27.  
  28. Wait_InfoNet:
  29.  
  30.     wait
  31.         "#"              goto Send_Response,
  32.     "Center"               goto Send_InfoNet_Host,
  33.     "Centre"             goto Send_InfoNet_Host,
  34.     "COMMUNICATION"         goto Return_Success
  35.     until Timeout;
  36.  
  37.     Timeout = 50;
  38.     if Tries = 0 goto InfoNet_Failure;
  39.  
  40.     Tries = Tries - 1;
  41.     send %CR & %CR & %CR;
  42.     goto Wait_InfoNet;
  43.  
  44. Send_Response:
  45.  
  46.     if Got_Center goto Wait_InfoNet;
  47.  
  48.     send "C" & %CR;
  49.     Timeout = 195;
  50.     goto Wait_InfoNet;
  51.  
  52. Send_InfoNet_Host:
  53.  
  54.     if Europe goto Send_InfoNet_Europe_Host;
  55.     send "CPS" & %CR;
  56.     goto Finish_Send_Host;
  57.  
  58. Send_InfoNet_Europe_Host:
  59.  
  60.     send "CSF" & %CR;
  61.  
  62. Finish_Send_Host:
  63.  
  64.     FailStr = "InfoNet not connecting";
  65.     if Tries = 0 goto InfoNet_Failure;
  66.  
  67.     Tries = Tries - 1;
  68.     Got_Center = %TRUE;
  69.     Timeout = 835;
  70.     goto Wait_InfoNet;
  71.  
  72. InfoNet_Failure:
  73.     define %FailureMsg = FailStr;
  74.     exit %Failure;
  75.  
  76. Return_Cancel:
  77.     exit %Cancel;
  78.  
  79. Return_Success:
  80.     exit %Success;
  81.