home *** CD-ROM | disk | FTP | other *** search
/ PowerPlay 1998 July / PowerPlay0798.bin / Online / Cserve / SCRIPTS.LIB / infonet.scr < prev    next >
Text File  |  1997-07-08  |  4KB  |  143 lines

  1. !
  2. !  Copyright (c) 1997
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  InfoNet:
  9. !       Connect to InfoNet or InfoNet-Europe.  Arg1 contains TRUE if
  10. !       connect is to InfoNet-Europe and FALSE otherwise.
  11. !       Success:  returns %Success
  12. !       Failure:  saves error msg in %FailureMsg and returns %Failure
  13. !       Arg1: 0 - InfoNet World, 1 - InfoNet Europe, 2 - Infonet Korea,
  14. !               3 - InfoNet Taiwan, 4 - InfoNet Mexico, 5 - InfoNet S. Africa
  15. !+V
  16. ! "4.0.2"
  17. !-V
  18.  
  19. Which_InfoNet = Arg1;
  20. if Which_InfoNet = 1 goto Init_Europe;
  21. if Which_InfoNet = 2 goto Init_Korea;
  22. if Which_InfoNet = 3 goto Init_Taiwan;
  23. if Which_InfoNet = 4 goto Init_Mexico;
  24. if Which_InfoNet = 5 goto Init_SAfrica;
  25.  
  26. show "Verbindungsaufbau mit dem InfoNet-World";
  27. FailStr = "InfoNet-World antwortet nicht";
  28. FailStr2 = "InfoNet-World antwortet nicht";
  29. goto Init_Common;
  30.  
  31. Init_Europe:
  32.     show "Verbindungsaufbau mit dem InfoNet-Euro";
  33.     FailStr = "InfoNet-Euro antwortet nicht";
  34.     FailStr2 = "InfoNet-Euro antwortet nicht";
  35.     goto Init_Common;
  36.  
  37. Init_Korea:
  38.     show "Verbindungsaufbau mit dem InfoNet-Korea";
  39.     FailStr = "InfoNet-Korea antwortet nicht";
  40.     FailStr2 = "InfoNet-Korea antwortet nicht";
  41.     goto Init_Common;
  42.  
  43. Init_Taiwan:
  44.     show "Verbindungsaufbau mit dem InfoNet-Taiwan";
  45.     FailStr = "InfoNet-Taiwan antwortet nicht";
  46.     FailStr2 = "InfoNet-Taiwan antwortet nicht";
  47.     goto Init_Common;
  48.  
  49. Init_Mexico:
  50.     show "Verbindungsaufbau mit dem InfoNet-Mexico";
  51.     FailStr = "InfoNet-Mexico antwortet nicht";
  52.     FailStr2 = "InfoNet-Mexico antwortet nicht";
  53.     goto Init_Common;
  54.  
  55. Init_SAfrica:
  56.     show "Verbindungsaufbau mit dem InfoNet-South Africa";
  57.     FailStr = "InfoNet-South Africa antwortet nicht";
  58.     FailStr2 = "InfoNet-South Africa antwortet nicht";
  59.     ! fall through
  60.  
  61. Init_Common:
  62.     Tries = 5;
  63.     Timeout = 10;
  64.     Got_Center = %FALSE;
  65.     on cancel goto Return_Cancel;
  66.  
  67. Wait_InfoNet:
  68.     wait
  69.         %mdm_Failure    goto NO_Carrier,
  70.         "CLR ERR"       goto InfoNet_Failure,
  71.         "#"             goto Send_Response,
  72.         "Center"        goto Send_InfoNet_Host,
  73.         "Centre"        goto Send_InfoNet_Host,
  74.         "COMMUNICATION" goto Wait_HostName
  75.     until Timeout;
  76.  
  77.     Timeout = 50;
  78.     if Tries = 0 goto InfoNet_Failure;
  79.  
  80.     Tries = Tries - 1;
  81.     send %CR & %CR & %CR;
  82.     goto Wait_InfoNet;
  83.  
  84. Send_Response:
  85.     if Got_Center goto Wait_InfoNet;
  86.     send "C" & %CR;
  87.     Timeout = 195;
  88.     goto Wait_InfoNet;
  89.  
  90. Send_InfoNet_Host:
  91.     show "CompuServe-Adresse wird ⁿbertragen...";
  92.     if Which_InfoNet = 0 goto Send_InfoNet_World_Host;
  93.     if Which_InfoNet = 1 goto Send_InfoNet_Europe_Host;
  94.  
  95.     send "CPS" & %CR;
  96.     goto Finish_Send_Host;
  97.  
  98. Send_InfoNet_World_Host:
  99.     send "CSI" & %CR;
  100.     goto Finish_Send_Host;
  101.  
  102. Send_InfoNet_Europe_Host:
  103.     send "CSF" & %CR;
  104.     goto Finish_Send_Host;
  105.  
  106. Finish_Send_Host:
  107.     FailStr = FailStr2;
  108.     if Tries = 0 goto InfoNet_Failure;
  109.  
  110.     Tries = Tries - 1;
  111.     Got_Center = %TRUE;
  112.     Timeout = 835;
  113.     goto Wait_InfoNet;
  114.  
  115. NO_Carrier:
  116.     FailStr = "Modemverbindung wurde abgebrochen";
  117. InfoNet_Failure:
  118.     define %FailureMsg = FailStr;
  119.     exit %Failure;
  120.  
  121. Return_Cancel:
  122.     exit %Cancel;
  123.  
  124. Wait_HostName:
  125.     Tries = 3;
  126.     goto Wait_UserID;
  127.  
  128. Send_ToHostName:
  129.     Tries = Tries - 1;
  130.     send "/HOST" & %CR;
  131.  
  132. Wait_UserID:
  133.     if Tries = 0 goto InfoNet_Failure;
  134.     wait
  135.         %mdm_Failure    goto NO_Carrier,
  136.         "User ID:"      goto Send_ToHostName,
  137.         "Host Name:"    goto Return_Success
  138.     until 25;               
  139.     goto Send_ToHostName;
  140.    
  141. Return_Success:
  142.     exit %Success;
  143.