home *** CD-ROM | disk | FTP | other *** search
/ PC Direkt 1995 #3 / PCD_395.iso / kommunik / wincim_d / disk1 / scripts.lib / CSERVE.SCR < prev    next >
Encoding:
Text File  |  1994-04-14  |  3.8 KB  |  187 lines

  1. !
  2. !  Copyright (c) 1993
  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. !  CSERVE:
  9. !    Connect to CIS.
  10. !    First argument is %TRUE if direct connect and %FALSE otherwise
  11. !    Success:  returns %Success
  12. !    Failure:  saves error msg in %FailureMsg and returns %Failure
  13. !        or %Fatal (depending on severity).
  14. !
  15. !+V
  16. ! "3.4.1"
  17. !-V
  18.  
  19. DirectConnect = Arg1;
  20. show "Verbindungsaufbau mit dem CompuServe-Netzwerk";
  21. Tries = 7;
  22. on cancel goto Return_Cancel;
  23. FirstTry = %TRUE;
  24. FailStr = "";
  25. ETX = "^C";
  26. CompuServeHost = "CPS^M";
  27. ifndef %X121Address = "";
  28. ifndef %OKCmd = "";
  29. ifndef %StopAtHost = "";
  30.  
  31. Start_Connect:
  32.     if Tries = 0 goto CIS_Failure;
  33.     Tries = Tries - 1;
  34.  
  35. Connect_Wait:
  36.     wait
  37.         "UIC:"        goto Send_ETX,
  38.         "Host Name:"    goto Send_Host_Name,
  39.         "User ID:"    goto Send_ID,
  40.         "Password:"    goto Send_Password,
  41.         "XPAD"        goto Send_XPAD,
  42.         %mdm_Failure    goto CIS_No_Carrier
  43.     until 80;
  44.  
  45.     if not DirectConnect goto Send_CR;
  46.     sendm "###";
  47.  
  48. Send_CR:
  49.     send %CR;
  50.     goto Start_Connect;
  51.  
  52. Send_ETX:
  53.     send ETX;
  54.     goto Connect_Wait;
  55.  
  56. Send_Host_Name:
  57.     if Arg2 goto No_Wait;
  58.     wait until 10;
  59. No_Wait:
  60.     if %StopAtHost = "" goto Send_No_Stop;
  61.     if %StopAtHost = "1" goto Return_Success;
  62.     send CompuServeHost;
  63.     goto Return_Success;
  64.  
  65. Send_No_Stop:
  66.     send CompuServeHost;
  67.     goto Connect_Wait;
  68.  
  69. Send_ID:
  70.     show "Anmelden bei CompuServe";
  71.     send %UserID & %LogonParams & "/INT\" & %Password & %CR;
  72.     goto Logon_Wait;
  73.  
  74. Send_XPAD:
  75.     send %X121Address & %CR;
  76.     goto Connect_Wait;
  77.  
  78. Send_Password:
  79.     send %Password;
  80.  
  81. Logon_Wait:
  82.     wait
  83.         "CompuServe"    goto Return_Success,
  84.         "^[[>"        goto Return_Success,
  85.         "^F"        goto Return_Success,
  86.         "? LOG"        goto Process_Log_Msg,
  87.         "??LOG"        goto Process_Log_Msg,
  88.         " NTW"        goto Logon_Failure,
  89.         "OK^M"        goto Send_OK_Cmd,
  90.         "^[I"        goto Send_Response,
  91.         %mdm_Failure    goto CIS_No_Carrier
  92.     until 200;
  93.  
  94.     goto CIS_Failure;
  95.  
  96. Process_Log_Msg:
  97.     wait
  98.         "INE"    goto Bad_ID,
  99.         "ISX"    goto Bad_ID_Syntax,
  100.         "CAI"    goto Cannot_Auto_Irun,
  101.         "SIL"    goto System_Unavailable,
  102.         "SIU"    goto System_Unavailable,
  103.         "SNA"    goto System_Unavailable,
  104.         "STU"    goto Check_User_ID,
  105.         "UTL"    goto Too_Many_Users
  106.     until 50;
  107.  
  108.     goto Try_Again;
  109.  
  110. Too_Many_Users:
  111.     define %FailureMsg = "Zuviele User gleichzeitig";
  112.     exit %Failure;
  113.  
  114. Cannot_Auto_Irun:
  115.     define %FailureMsg = "Konnte 'Auto Irun HMI server' nicht starten";
  116.     exit %Failure;
  117.  
  118. Bad_ID:
  119.     FailStr = "User-ID oder Passwort ungⁿltig";
  120.     goto Try_Again;
  121.  
  122. Bad_ID_Syntax:
  123.     FailStr = "User-ID Syntax ungⁿltig";
  124.     goto Try_Again;
  125.  
  126. System_Unavailable:
  127.     define %FailureMsg = "Host nicht verfⁿgbar, spΣter versuchen";
  128.     exit %Fatal;
  129.  
  130. Check_User_ID:
  131.     define %FailureMsg = "System nicht verfugbar, bitte User-ID uberprufen";
  132.     exit %Fatal;
  133.  
  134. Try_Again:
  135.     if not FirstTry goto CIS_Fatal;
  136.     send ETX;
  137.     FirstTry = %FALSE;
  138.  
  139.     wait
  140.         "User ID"    goto Send_ID,
  141.         %mdm_Failure    goto CIS_No_Carrier
  142.     until 140;
  143.  
  144.     goto CIS_Fatal;
  145.  
  146. Logon_Failure:
  147.     define %FailureMsg = "Host ist vorⁿbergehend nicht verfⁿgbar";
  148.     exit %Fatal;
  149.  
  150. Send_OK_Cmd:
  151.     if %OKCmd = "" goto Logon_Wait;
  152.     send %OKCmd & %CR;
  153.     goto Logon_Wait;
  154.  
  155. Send_Response:
  156.     sendi %ESCIResponse;
  157.     exit %Success;
  158.  
  159. CIS_Failure:
  160.     if FailStr <> "" goto Return_Fail_Msg;
  161.     define %FailureMsg = "Konnte Verbindung mit dem Host nicht aufbauen";
  162.     exit %Failure;
  163.  
  164. CIS_No_Carrier:
  165.     if FailStr <> "" goto Return_Fail_Msg;
  166.     define %FailureMsg = "Modemverbindung wurde abgebrochen";
  167.     exit %Failure;
  168.  
  169. CIS_Fatal:
  170.     if FailStr <> "" goto Return_Fatal_Msg;
  171.     define %FailureMsg = "Konnte Verbindung mit dem Host nicht aufbauen";
  172.     exit %Fatal;
  173.  
  174. Return_Fail_Msg:
  175.     define %FailureMsg = FailStr;
  176.     exit %Failure;
  177.  
  178. Return_Fatal_Msg:
  179.     define %FailureMsg = FailStr;
  180.     exit %Fatal;
  181.  
  182. Return_Success:
  183.     exit %Success;
  184.  
  185. Return_Cancel:
  186.     exit %Cancel;
  187.