home *** CD-ROM | disk | FTP | other *** search
/ 100 Great Kid's Games 1 / 100_KIDS_GA.ISO / compsrv / scripts.lib / INFONET.SCR < prev    next >
Text File  |  1995-12-05  |  3KB  |  126 lines

  1. !
  2. !  Copyright (c) 1995
  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. ! "3.8.1"
  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 "Connecting to InfoNet World";
  27. FailStr = "InfoNet World not responding";
  28. FailStr2 = "InfoNet World not connecting";
  29. goto Init_Common;
  30.  
  31. Init_Europe:
  32.     show "Connecting to InfoNet Euro";
  33.     FailStr = "InfoNet Euro not responding";
  34.     FailStr2 = "InfoNet Euro not connecting";
  35.     goto Init_Common;
  36.  
  37. Init_Korea:
  38.     show "Connecting to InfoNet Korea";
  39.     FailStr = "InfoNet Korea not responding";
  40.     FailStr2 = "InfoNet Korea not connecting";
  41.     goto Init_Common;
  42.  
  43. Init_Taiwan:
  44.     show "Connecting to InfoNet Taiwan";
  45.     FailStr = "InfoNet Taiwan not responding";
  46.     FailStr2 = "InfoNet Taiwan not connecting";
  47.     goto Init_Common;
  48.  
  49. Init_Mexico:
  50.     show "Connecting to InfoNet Mexico";
  51.     FailStr = "InfoNet Mexico not responding";
  52.     FailStr2 = "InfoNet Mexico not connecting";
  53.     goto Init_Common;
  54.  
  55. Init_SAfrica:
  56.     show "Connecting to InfoNet South Africa";
  57.     FailStr = "InfoNet South Africa not responding";
  58.     FailStr2 = "InfoNet South Africa not connecting";
  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 Return_Success
  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 "Sending CompuServe Address...";
  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 = "Modem connection lost";
  117. InfoNet_Failure:
  118.     define %FailureMsg = FailStr;
  119.     exit %Failure;
  120.  
  121. Return_Cancel:
  122.     exit %Cancel;
  123.  
  124. Return_Success:
  125.     exit %Success;
  126.