; HAYES.SCR ; MS-Kermit Script for dialing a Hayes 2400 modem. ; Requires MS-Kermit 2.32 or later and a Hayes 2400 (not 1200) modem. ; To use: ; ; 1. Rename this file to HAYES.SCR if necessary ; 2. Enter the Kermit command: define dial take hayes.scr ; 3. dial nnnnnnn (where nnnnnnn is the phone number) ; ; C. Gianone, Columbia University, December 1988 ; def errstop echo \%1\13, def \%1, hang, stop ; Error handler. if not defined \%1 errstop {Please supply a phone number!} assign \%n \%1 ; Copy the phone number. clear ; Clear the input buffer. set speed 2400 ; Dial at high speed. wait 2 \cts ; Is modem turned on? if fail errstop {Please turn on your modem.} ; No. echo Initializing modem...\13\10 ; Yes. output ATZ\13 ; Reset the modem. pause 2 ; Give it a little time. output AT F1 Q0 V1 X4 S0=0\13 ; Put modem in known state. input 8 OK ; Look for response. if fail errstop {Can't initialize modem.} pause 1 ; Pause for a second first. set count 5 ; Set the redial limit. define \%d \13Dialing ; Initial dial message. :REDIAL echo \%d \%n...\13\10 ; Tell them we're dialing. output ATDT\%n\13 ; Dial the phone number. clear ; Clear away the command echo. input 60 CONNECT ; Wait for CONNECT message. if success goto speed ; Got it, go check speed. define \%m No dialtone or no answer. ; Make this the error message. reinput BUSY ; Didn't connect. Was it busy? if failure errstop {\%m\10\13Try again later.} ; No Echo \13Busy... ; It's busy, let them know. hangup ; Drop DTR momentarily. pause 60 ; Wait one minute. define \%d \13Redialing ; Change message to "Redialing". if count goto redial ; Then go redial. define \%m \13Line busy. ; After 5 tries set this message. :SPEED ; Connected! pause 1 ; Wait for text after CONNECT. define \%s 2400 ; Assume speed is 2400. reinput 1 2400 ; Rescan current text for "2400" if success goto done ; It is. define \%s 1200 ; It isn't, so assume 1200. reinput 1 1200 ; Is it? if failure define \%s 300 ; It isn't, so it must be 300. :DONE ; We know the speed. set speed \%s ; So set it. echo Connecting at \%s bps...\13 ; Tell the user. pause 2 ; Give her a chance to read it. set terminal clear ; Clear screen. define \%1 ; Clear argument. connect ; And start terminal emulation.