home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / mskerm30.zip / HAYES.TAK < prev    next >
Text File  |  1990-01-18  |  2KB  |  51 lines

  1. ; FILE HAYES.TAK
  2. ;
  3. ; An MS-DOS Kermit 3.0 script program for dialing a Hayes 2400 Smartmodem
  4. ; and compatibles.  Also works with ROLMphone 244PC.
  5. ; Expects variable %\1 to contain the phone number; this is done by the
  6. ; DIAL macro defined in MSKERMIT.INI. 
  7. ; Author: Christine M. Gianone, January 1990
  8. ;
  9. COMMENT - Initial setup
  10.   def errstop echo Error: \%1\13,def \%1,hang,stop
  11.   set speed 2400        ; *** Change to 1200 for Smartmodem 1200
  12.   set input timeout proceed    ; So IF SUCCESS and IF FAILURE can be used
  13.   set input echo off        ; Don't echo modem test
  14.   output AT\13            ; Send "AT" and carriage return
  15.   input 2 OK            ; Look for modem's "OK" response
  16.   if fail errstop {Turn on or connect your modem!}
  17.   set count 5            ; Modem is OK, set up dialing loop
  18.   clear                ; Clear away old modem echoes
  19.   set input echo on        ; From now on, show what's happening
  20.   echo \13Dialing \%1.    Wait...\13\10  ; Dialing for the first time,
  21.   goto dial            ; so skip the "Redialing" message
  22.  
  23. COMMENT - Dialing loop
  24. :REDIAL
  25.   echo \13Redialing...\13\10    ; Give this message when redialing
  26. :DIAL
  27.   output ATDT\%1\13        ; Dial the number
  28.   input 60 \10            ; Wait 60 secs for a linefeed from modem
  29.   if fail errstop {No response from modem.} ; No message within 1 minute
  30.   reinput 1 CONNECT        ; Got a message, was it CONNECT?
  31.   if success goto speed        ; If so, go and check speed
  32.   reinput 1 BUSY        ; Not CONNECT, was it BUSY?
  33.   if failure errstop {No dialtone or no answer.} ; Neither one
  34.   Echo \13Busy...        ; It's busy, say so
  35.   hangup            ; Hang up the phone
  36.   pause 60            ; Wait one minute
  37.   if count goto redial        ; Then go redial
  38.  
  39. COMMENT - Come here after 5 unsuccesful tries
  40.   errstp {It's always busy!  I give up.} 
  41.  
  42. :SPEED                ; Connected!
  43.   pause 1            ; Wait one second for more text
  44.   reinput 1 2400        ; Was the message CONNECT 2400?
  45.   if succ set speed 2400    ; Yes, set speed to 2400
  46.   reinput 1 1200        ; Was it CONNECT 1200?
  47.   if success set speed 1200    ; If so, set speed to 1200
  48.  
  49. :DONE                ; All done.
  50.   stop                ; Stop executing this script.
  51.