home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR31 / KERM313.ZIP / SPORT.SCR < prev    next >
Text File  |  1993-07-07  |  5KB  |  129 lines

  1. ; FILE SPORT.SCR (MSMSPORT.SCR)
  2. ;
  3. ; An MS-DOS Kermit script program for dialing the US Robotics Sportster
  4. ; 14400 modem, to be used with MS-DOS Kermit 3.11 or later.
  5. ; The modem is set for V.32bis, compression, error correction, all types of 
  6. ; fallback, RTS/CTS flow control, fixed interface speed of 57600 or 38400.
  7. ;
  8. ; To use: SET MODEM=SPORT (in DOS, before starting Kermit)
  9. ; or:     DEFINE _MODEM SPORT (in Kermit, before dialing)
  10. ; and:    Make sure Kermit executes the standard MSKERMIT.INI file.
  11. ;
  12. ; Authors: Christine M. Gianone, Frank da Cruz; Columbia U, June 1993
  13. ;
  14. def errfail echo \%1, hangup, goto fail ; Macro to handle failures.
  15. if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.}
  16. if eq "\v(system)" "UNIX" if = \v(local) 0 stop 1 You must SET LINE first
  17.  
  18. define chkerr if fail stop 1 \%1
  19. define chkok input 3 OK, if fail stop 1 \%1
  20.  
  21. set input echo on        ; So we can watch what happens.
  22. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE.
  23. set input case ignore        ; Use caseless string comparisons
  24.  
  25. set parity none            ; Avoid parity foulups
  26. set flow none            ; Avoid flow control deadlocks
  27. hangup                ; Begin by dropping DTR
  28. pause 1                ; for one second
  29.  
  30. ; Speed.  Don't worry about modem, it autobauds up to 57600 bps.
  31.  
  32. set speed 57600            ; If computer can be set to 57600 bps, use it.
  33. if fail set speed 38400        ; If not, use 38400.
  34.  
  35. wait 0 DSR            ; Check modem signals that should be on
  36. chkerr {No DSR signal - check your modem and cable}
  37. wait 0 CTS
  38. chkerr {No CTS signal - check your modem and cable}
  39.  
  40. echo Configuring USR Sportster 14400 on \v(line).
  41.  
  42. :INIT
  43. output ATQ0V1\13        ; Enable word result codes
  44. chkok {Can't get modem's attention}
  45. output AT E1 W1 X4 &A3 &D2\13    ; Set echoing, result codes, etc.
  46. chkok {Can't initialize modem}
  47. output AT&B1\13            ; Fixed interface speed
  48. chkok {Can't fix interface speed}
  49. output AT &H1&R2\13        ; RTS/CTS hardware flow control
  50. chkok {Can't enable RTS/CTS}    ; On modem
  51. set flow rts/cts        ; And in Kermit too, but only now
  52. output AT &N0\13
  53. chkok {Can't enable modulation fallback}
  54. output AT &K1&M4\13        ; Compression and EC enabled
  55. chkok {Can't enable compression and EC}
  56. output AT &Y3\13        ; Make modem pass BREAK transparently
  57. chkok {Can't become transparent to BREAK}
  58.  
  59. if def \%1 if not equal "\%1" "=" goto BEGIN
  60. echo Modem initialization complete, no number to dial
  61. end 0
  62.  
  63. :BEGIN                ; Now DIAL.
  64. clear                ; Clear INPUT buffer.
  65. set count 5                     ; Dialing retry counter, 5 tries allowed.
  66. echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
  67. echo
  68. pause 1
  69. goto dial                       ; 1st time, skip pause and Redialing message
  70.  
  71. :REDIAL
  72. set alarm 30
  73. pause 30            ; Wait 30 seconds before redialing.
  74. if not alarm errfail {Dialing canceled.}
  75. echo Redialing...               ; Message for redialing.
  76. pause 1
  77.  
  78. :DIAL
  79. output ATD\%1\13                ; Dial the number.
  80. set alarm 90            ; (For detecting keyboard interruptions.)
  81. if > VERSION 312 clear input    ; Clear echo from INPUT buffer.
  82. if < VERSION 313 clear
  83. input 30 \10                    ; Wait for the linefeeds...
  84.  
  85. :GETMSG
  86. input 60 \10            ; ...that surround the response message.
  87. if success goto gotmsg        ; Got a message.
  88. if alarm errfail {No response from modem.} ; No response in 90 seconds.
  89. hangup                ; User interrupted from keyboard,
  90. output \13            ; cancel dialing by sending carriage return,
  91. goto again            ; and go try again right away.
  92.  
  93. :GOTMSG
  94. reinput 1 CONNECT               ; Got a message, was it CONNECT?
  95. if success goto done            ; If so, we're done.
  96. reinput 1 BUSY            ; Line is busy.
  97. if success goto busy        ; Go wait a while and then dial again.
  98. reinput 1 ERROR            ; Command syntax error.
  99. if success errfail {Dialing command error}
  100. reinput 1 NO CARRIER        ; Phone didn't answer or no carrier.
  101. if success errfail {No answer or no carrier}
  102. reinput 1 NO ANSWER        ; No answer
  103. if success errfail {No answer - try again later}
  104. reinput 1 NO DIAL TONE        ; No dialtone when phone taken off hook.
  105. if success errfail {No dialtone - Is your modem connected to the phone line\63}
  106. goto getmsg            ; None of the above, get another message.
  107.  
  108. :BUSY
  109. if < \v(count) 2 goto quit    ; Don't wait 30 seconds if tries are used up.
  110. Echo Line is busy, will dial again in 30 seconds.
  111. echo Press any key to cancel...
  112. output \13            ; CR cancels dialing
  113. hangup                          ; Hang up.
  114. :AGAIN
  115. if count goto redial            ; Then go redial.
  116. :QUIT
  117. errfail {It never answers!  I give up.} ; Too many tries.
  118.  
  119. :DONE                           ; Connected.
  120. echo \7                         ; Celebrate with a beep.
  121. define errfail            ; Erase local macro definitions...
  122. end 0                ; Finished, return success code.
  123.  
  124. :FAIL                ; Dialing failed, no beep.
  125. define errfail            ; Erase local macro definitions...
  126. end 1                ; Return failure code.
  127.  
  128. ; End of SPORT.SCR
  129.