home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / cu / cnet.scr < prev    next >
Text File  |  2020-01-01  |  5KB  |  133 lines

  1. ; CNET.SCR
  2. ;
  3. ; Christine M. Gianone, CUCCA/AcIS, October 1991.
  4. ; Modified March 1994 for new access procedures, fdc.
  5. ; Unmercifully hacked down to ColumbiaNet only by Walter 3/94
  6. ;
  7. ; An MS-DOS Kermit script for easy access to Columbia University's
  8. ; ColumbiaNet system.  It navigates through ROLMphone and terminal server
  9. ; and gets the ColumbiaNet main menu.
  10. ;
  11. if not < version 311 goto OK
  12. echo Sorry, version 3.11 or later of MS-DOS Kermit is required.
  13. stop
  14.  
  15. :OK
  16.  
  17. ; Define ERRSTOP macro to issue an error message and stop.
  18. ;
  19. define errstop echo \%1, hangup, stop
  20.  
  21.  
  22. ; Communication and script settings
  23. ;
  24. ; Note: we don't override any settings from the user's MSKERMIT.INI file
  25. ; that are not necessary for this script.  User's speed, key settings,
  26. ; screen colors, etc, remain in effect.
  27. ;
  28. set input echo off        ; Cnet sends something that does 40char mode
  29. set parity none            ; Don't use parity.
  30. set display 7            ; But don't display it either.
  31. set flow xon/xoff        ; Use Xon/Xoff flow control.
  32. set handsh none            ; No handshake.
  33. set duplex full            ; Full duplex, remote echo.
  34. set input timeout proceed    ; This enables IF SUCCESS and IF FAILURE.
  35. set input case ignore        ; Don't care about alphabetic case.
  36. hangup                ; Hang up any current data connection. 
  37. pause
  38.  
  39. ; Try 3 times to get Rolmphone's attention.
  40. ;
  41. :LOOP
  42. output \13            ; Output a carriage return.
  43. :CBX                ; Assume DCM with CALL, DISPLAY OR MODIFY?
  44. input 6 MODIFY?            ; Look for CBX prompt.
  45. if failure goto RP244PC        ; If not found, go try 244PC.
  46. echo \13CBX dialing...\13\10        ; It's the CBX, tell the user.
  47. echo Please wait until full ColumbiaNet menu is displayed.\13\10
  48. output CALL CNET\13        ; Dial Cnet
  49. input 30 COMPLETE        ; Get CALL COMPLETE message
  50. if failure errstop -
  51.   {Sorry, ColumbiaNet does not answer.  Please try again later.}
  52. goto good            ; Got connected, go login
  53.  
  54. :RP244PC                        ; Let's see if it's a 244PC
  55. output \13AT\13            ; Give the Hayes modem AT command
  56. input 5 OK            ; Look for Hayes OK response.
  57. if failure goto RETRY        ; Not found, try again.
  58. echo 244PC dialing...\13\10    ; It's 244PC, tell the user.
  59. echo Please wait until full ColumbiaNet menu is displayed.\13\10
  60. output ATDT[CNET]\13        ; Make a data call to "[CUNIX]".
  61. input 30 CONNECT                ; Look for modem's confirmation.
  62. if success goto GOOD
  63.  
  64. :RETRY
  65. if count goto LOOP
  66.  
  67. ; Get here when there is no communication after 3 tries.
  68. ;
  69. echo
  70. echo {  Sorry, I can't seem to communicate with your ROLMphone.}
  71. echo {  Your port is \v(port), your speed is \v(speed).}
  72. echo {  If these parameters are not correct, use Kermit's SET PORT}
  73. echo {  and SET SPEED commands to correct them and try again.}
  74. echo {  Otherwise, please check the data cable between your PC}
  75. echo {  and the ROLMphone and try again.}
  76. echo
  77. hangup
  78. stop
  79.  
  80. :GOOD
  81. ; We got through, one way or the other.
  82. ; Send carriage returns for speed recognition.
  83. ; Try up to 5 times to get Info terminal server prompt, "CU-Info>".
  84. ;
  85. set count 5            ; Loop counter.
  86.  
  87. :AGAIN
  88. output \13
  89. input 5 vt100)            ; Look for prompt.
  90. if success goto INFO        ; If found, proceed with login process,
  91. if count goto again        ; otherwise continue the loop.
  92. errstop {Failure to get ColumbiaNet terminal prompt, please try again later.}
  93.  
  94. :INFO
  95. ;
  96. ; Got Cnet terminal type prompt
  97. ;
  98. output \13        ; Send CR to wake it up
  99. input 20 I=Info        ; Look for Cnet prompt line
  100. output \13        ; A CR to get menu re-displayed.
  101. if fail errstop {Failure to get ColumbiaNet menu, please try again later.}
  102. connect
  103. ;
  104. ; If they escaped back, check the carrier detect signal to see if they
  105. ; logged out, issue appropriate messages in each case.
  106. ;
  107. wait 1 CD
  108. if succ goto WARN
  109. echo
  110. ec \201\%9\187
  111. ec \186                                                                   \186
  112. ec \186  Your connection to ColumbiaNet is closed.                        \186
  113. ec \186  Type EXIT (then Enter) to leave Kermit and go back to DOS.       \186
  114. ec \186                                                                   \186
  115. ec \200\%9\188
  116. echo
  117. stop
  118.  
  119. :WARN
  120. echo
  121. ec \201\%9\187
  122. ec \186                                                                   \186
  123. ec \186 Back at PC but your ColumbiaNet connection might still be active. \186
  124. ec \186  Type CONNECT (then press the Enter key) to go back to it.        \186
  125. ec \186  Type HANGUP (then Enter) to close your ColumbiaNet session.      \186
  126. ec \186  Type EXIT (then Enter) to leave Kermit and go back to DOS.       \186
  127. ec \186                                                                   \186
  128. ec \200\%9\188
  129. echo
  130. stop
  131.  
  132. stop
  133.