home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
SYSOP
/
KERMIT.ZIP
/
FASTALK2.SCR
< prev
next >
Wrap
Text File
|
1994-10-13
|
5KB
|
131 lines
; FILE FASTALK2.SCR (MSMFASTALK.SCR)
;
; An MS-DOS Kermit script program for dialing the Motorola UDS FasTalk II
; modem, to be used with MS-DOS Kermit 3.12 or later. The modem is set up
; for compression, error correction, all types of fallback. RTS/CTS flow
; control, fixed interface speed of 57600 or 38400.
;
; Authors: Christine M. Gianone, Frank da Cruz; Columbia U, October 1994.
;
def errfail echo \%1, hangup, goto fail ; Macro to handle failures.
if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.}
define chkerr if fail stop 1 \%1
define chkok input 3 OK, if fail stop 1 \%1
; Macro to try to get attention of modem's command processor
; at the given speed, or if no speed given, at the current speed.
;
define atok -
if not def \%1 assign \%1 \v(speed), -
set speed \%1, -
echo Trying \%1..., -
output ATQ0V1\13, -
input 3 OK, -
end \v(status)
set input echo on ; So we can watch what happens.
set input timeout proceed ; Allow IF SUCCESS, IF FAILURE.
set input case ignore ; Use caseless string comparisons
set parity none ; Avoid parity foulups
set flow none ; Avoid flow control deadlocks
hangup ; Begin by dropping DTR
pause 1 ; for one second
atok 57600 ; Autobaud...
if fail atok 38400
if fail atok 19200
if fail atok 9600
if fail stop 1 Can't get modem's attention.
def atok
output AT E1&C1&D2&S0X4\92V1\92E0\13 ; Echoing, result codes, etc.
chkok {Can't initialize modem}
echo Configuring Motorola UDS FasTalk II...
out ATB1 S7=85 S25=50\13 ; Modulation fallback, timers
chkok {Can't set data modulation and timers}
echo Enabling hardware flow control...
output AT \92G1\92Q3\13
chkok {Can't enable RTS/CTS}
wait 5 cts
if fail errfail {Modem is not asserting CTS!}
set flow rts/cts
echo Configuring modem to pass BREAK...
output AT \92K5\13
chkok {Can't become transparent to BREAK}
echo Enabling error correction and data compression...
output AT \92N6\92J0%C1\13
chkok {Can't enable compression EC and fallback}
if def \%1 if not equal "\%1" "=" goto BEGIN
echo Modem initialization complete, no number to dial
end 0
:BEGIN ; Now DIAL.
clear ; Clear INPUT buffer.
set count 5 ; Dialing retry counter, 5 tries allowed.
echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
echo
pause 1
goto dial ; 1st time, skip pause and Redialing message
:REDIAL
set alarm 30
pause 30 ; Wait 30 seconds before redialing.
if not alarm errfail {Dialing canceled.}
echo Redialing... ; Message for redialing.
pause 1
:DIAL
output ATD\%1\13 ; Dial the number.
set alarm 90 ; (For detecting keyboard interruptions.)
clear input ; Clear echo from INPUT buffer.
input 30 \10 ; Wait for the linefeeds...
:GETMSG
input 60 \10 ; ...that surround the response message.
if success goto gotmsg ; Got a message.
if alarm errfail {No response from modem.} ; No response in 90 seconds.
hangup ; User interrupted from keyboard,
output \13 ; cancel dialing by sending carriage return,
goto again ; and go try again right away.
:GOTMSG
reinput 1 CONNECT ; Got a message, was it CONNECT?
if success goto done ; If so, we're done.
reinput 1 BUSY ; Line is busy.
if success goto busy ; Go wait a while and then dial again.
reinput 1 ERROR ; Command syntax error.
if success errfail {Dialing command error}
reinput 1 NO CARRIER ; Phone didn't answer or no carrier.
if success errfail {No carrier}
reinput 1 NO ANSWER ; No answer
if success errfail {No answer}
reinput 1 NO DIALTONE ; No dialtone when phone taken off hook.
if success errfail {No dialtone - Is your modem connected to the phone line\63}
goto getmsg ; None of the above, get another message.
:BUSY
if < \v(count) 2 goto quit ; Don't wait 30 seconds if tries are used up.
Echo Line is busy, will dial again in 30 seconds
echo Press any key to cancel...
output \13 ; CR cancels dialing
hangup ; Hang up.
:AGAIN
if count goto redial ; Then go redial.
:QUIT
errfail {It never answers! I give up.} ; Too many tries.
:DONE ; Connected.
echo \7 ; Celebrate with a beep.
def errfail ; Erase local macro definitions...
end 0 ; Finished, return success code.
:FAIL ; Dialing failed, no beep.
def errfail ; Erase local macro definitions...
end 1 ; Return failure code.
; End of FASTALK2.SCR