home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
n
/
newscr.zip
/
NEWSCR.EXE
/
CSERVE.SCR
< prev
next >
Wrap
Text File
|
1993-02-05
|
4KB
|
156 lines
!---------------------------------------------------------------------!
! !
! Copyright (c) 1991 !
! by CompuServe Incorporated, Columbus, Ohio !
! !
! The information in this software is subject to change without !
! notice and should not be construed as a commitment by CompuServe. !
! !
! CSERVE Script: !
! Connect to CIS. !
! First argument is %TRUE if direct connect and %FALSE otherwise !
! Success: returns %Success !
! Failure: saves error msg in %FailureMsg and returns %Failure !
! or %Fatal (depending on severity). !
! !
! $Revision:: 1.7 $ !
! !
!---------------------------------------------------------------------!
DirectConnect = Arg1;
show "Connecting to CompuServe Network";
Tries = 7;
on cancel goto Return_Cancel;
FirstTry = %TRUE;
FailStr = "";
ETX = "^C";
CompuServeHost = "CPS^M";
Start_Connect:
if Tries = 0 goto CIS_Failure;
Tries = Tries - 1;
Connect_Wait:
wait
"UIC:" goto Send_ETX,
"Host Name:" goto Send_Host_Name,
"User ID:" goto Send_ID,
"Password:" goto Send_Password
until 80;
if not DirectConnect goto Send_CR;
sendm "###";
Send_CR:
send %CR;
goto Start_Connect;
Send_ETX:
send ETX;
goto Connect_Wait;
Send_Host_Name:
if Arg2 goto No_Wait;
wait until 10;
No_Wait:
send CompuServeHost;
goto Connect_Wait;
Send_ID:
show "Logging onto CompuServe";
send %UserID & %LogonParams & "/INT\" & %Password & %CR;
goto Logon_Wait;
Send_Password:
send %Password;
Logon_Wait:
wait
"CompuServe" goto Return_Success,
"^F" goto Return_Success,
"? LOG" goto Process_Log_Msg,
"??LOG" goto Process_Log_Msg,
" NTW" goto Logon_Failure,
"^[" goto Send_Response
until 200;
goto CIS_Failure;
Process_Log_Msg:
wait
"INE" goto Bad_ID,
"ISX" goto Bad_ID_Syntax,
"CAI" goto Cannot_Auto_Irun,
"SIL" goto System_Unavailable,
"SIU" goto System_Unavailable,
"SNA" goto System_Unavailable,
"STU" goto System_Unavailable,
"UTL" goto Too_Many_Users
until 50;
goto Try_Again;
Too_Many_Users:
define %FailureMsg = "Simultaneous users exceeded";
exit %Failure;
Cannot_Auto_Irun:
define %FailureMsg = "Cannot Auto Irun HMI server";
exit %Failure;
Bad_ID:
FailStr = "Incorrect user ID or password";
goto Try_Again;
Bad_ID_Syntax:
FailStr = "Incorrect user ID syntax";
goto Try_Again;
System_Unavailable:
define %FailureMsg = "The system is unavailable, try again later";
exit %Fatal;
Try_Again:
if not FirstTry goto CIS_Fatal;
send ETX;
FirstTry = %FALSE;
wait
"User ID" goto Send_ID
until 140;
goto CIS_Fatal;
Logon_Failure:
define %FailureMsg = "Remote is busy or unavailable";
exit %Fatal;
Send_Response:
sendi %ESCIResponse;
exit %Success;
CIS_Failure:
if FailStr <> "" goto Return_Fail_Msg;
define %FailureMsg = "Unable to connect to CompuServe host";
exit %Failure;
CIS_Fatal:
if FailStr <> "" goto Return_Fatal_Msg;
define %FailureMsg = "Unable to connect to CompuServe host";
exit %Fatal;
Return_Fail_Msg:
define %FailureMsg = FailStr;
exit %Failure;
Return_Fatal_Msg:
define %FailureMsg = FailStr;
exit %Fatal;
Return_Success:
exit %Success;
Return_Cancel:
exit %Cancel;