home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Buyer 1997 February
/
DPCB0297.iso
/
internet
/
CSI301
/
SCRIPTS.LIB
/
DISCONCT.SCR
< prev
next >
Wrap
Text File
|
1996-09-23
|
3KB
|
167 lines
!
! Copyright (c) 1996
! 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.
!
! DISCONCT:
! Handles all network/modem disconnections
! %LOCAL = 1 if hanging up while network script running
! = 2 if hanging up before connection
!
!+V
! "3.9.1"
!-V
WaitTime = 80;
attempts = 0;
CompuServe = 1;
SprintNet = 2;
CSIRnet = 16;
Datex_J = 19;
Internet = 25;
Direct = 40;
Result = %Success;
ifndef %BreakChar = "#";
define %State = 10;
DirectConnect = (%Network = Direct) or (%DialType = 2);
ifndef %LOCAL = 0;
if %LOCAL = 1 goto Do_Local_Hangup;
if %LOCAL = 2 goto Send_Hangup;
if %Network = Internet goto Exit_Script;
if %Network = CompuServe goto Start_Wait;
if %Network = Direct goto Start_Wait;
if %Network = Datex_J goto Hangup_Datex_J;
if %Network = SprintNet goto Hangup_SprintNet;
if %Network = CSIRnet goto Hangup_CSIRnet;
goto Do_Local_Hangup;
Start_Wait:
wait
"XPAD:" goto Hangup_Complete,
"ITI:" goto Hangup_Complete,
"Host Name:" goto Send_Bye,
"User ID:" goto Send_Host,
"Disconnected from host" goto PPP_Hangup,
"UIC:" goto Send_UIC,
%mdm_Failure goto Hangup_Complete
until WaitTime;
goto Do_Local_Hangup;
Send_Bye:
send "BYE^M";
if DirectConnect goto Hangup_Complete;
goto Wait_NO_CARRIER;
PPP_Hangup:
if DirectConnect goto Hangup_Complete;
goto Start_Wait;
Send_Host:
send "/HOST^M";
goto Start_Wait;
Send_UIC:
send "^C";
wait until 30;
goto Start_Wait;
Hangup_SprintNet:
show "Disconnecting from SprintNet";
wait
"disconnected" goto Send_Sprint_Hangup
until 60;
goto Do_Local_Hangup;
Send_Sprint_Hangup:
wait until 3;
send "HANGUP^M";
goto Wait_NO_CARRIER;
Hangup_CSIRnet:
show "Disconnecting from CSIR-Net";
wait until 40;
send "Z";
goto Wait_NO_CARRIER;
Hangup_Datex_J:
show "Disconnecting from Datex-J";
wait
"Host Name:" goto Send_OFF,
"CLR" goto Clear_PAD
until 100;
! fall through...
Clear_PAD:
wait until 60;
send "*9#";
goto Wait_NO_CARRIER;
Send_OFF:
send "OFF" & %CR;
goto Hangup_Datex_J;
Wait_NO_CARRIER:
if DirectConnect goto Hangup_Complete;
wait
"BYE^M" goto Hangup_Complete,
%mdm_Failure goto Hangup_Complete
until 30;
sendm %mdm_EscapeCode;
wait
%mdm_Failure goto Hangup_Complete,
%mdm_Ack goto Send_Hangup
until 20;
! fall through...
Do_Local_Hangup:
if DirectConnect goto Hangup_Direct;
define %State = 11;
wait until 20;
sendm %mdm_EscapeCode;
wait
%mdm_Ack goto End_Escape_Wait,
%mdm_Failure goto Hangup_Complete
until 20;
goto Send_Hangup;
End_Escape_Wait:
wait until 10;
! fall through...
Send_Hangup:
sendm %mdm_Prefix;
sendm %mdm_Hangup;
sendm %mdm_Suffix;
attempts = attempts + 1;
wait
%mdm_Ack goto Hangup_Complete,
%mdm_Failure goto Hangup_Complete
until 15;
if attempts = 2 goto Hangup_Complete;
goto Do_Local_Hangup;
Hangup_Direct:
sendm %BreakChar;
sendm %BreakChar;
sendm %BreakChar;
Hangup_Complete:
Result = %Cancel;
if %LOCAL > 0 goto Exit_Script;
call %Dir & "last.scr" () : Result;
Exit_Script:
define %State = 12;
define %LOCAL = 0;
exit Result;