home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / e / em200.zip / AUTOLOG.KRM < prev    next >
Text File  |  1992-04-29  |  4KB  |  146 lines

  1. ; -----------------------------------------------------------------------------
  2. ; Log on to a BBS and list new messages, saving them in msg.fil, then sign off
  3. ; -----------------------------------------------------------------------------
  4. del msg.fil
  5. log session msg.fil
  6.  
  7. ; -----------------------------------------------------------------------------
  8. ; define macros and variables
  9. ; -----------------------------------------------------------------------------
  10. def errstop echo \13\10\%1\13\10, goto :LOGOFF
  11. def \%p 9289228            ;First Capitol BBS (Area code 314)
  12. def \%f Don                ;First name
  13. def \%l Branson            ;Last name
  14. def \%a SIGNON             ;Password
  15.  
  16. echo \13\10Phone number: \%p\13\10
  17. clear                                ; Clear input buffer
  18. set speed 2400
  19.  
  20. ; -----------------------------------------------------------------------------
  21. ; Initialize modem
  22. ; -----------------------------------------------------------------------------
  23. echo Initializing modem...\13\10
  24. output ATZ\13
  25. pause 2
  26. output AT F1 Q0 V1 X4 S0=0\13
  27. input 8 OK
  28. if fail errstop {Can't initialize modem}
  29. echo \13\10Modem initialized
  30.  
  31. ; -----------------------------------------------------------------------------
  32. ; Dial the phone number
  33. ; -----------------------------------------------------------------------------
  34. set input case ignore
  35. set input timeout-action proceed
  36. set input echo on
  37.  
  38. pause 1
  39. set count 6                        ; Set redial limit
  40. define \%d \13Dialing
  41. :REDIAL
  42. run dtime
  43. echo \%d... \%p \13\10
  44. clear
  45. output ATDT \%p\13
  46. :CONLOOP
  47. reinput BUSY
  48. if success goto :BUSY
  49. reinput CONNECT
  50. if success goto :SPEED
  51. goto :CONLOOP
  52.  
  53. :BUSY
  54. echo \13Busy line
  55. if NOT count goto :LOGOFF
  56. echo \13Forcing hangup...\13\10
  57. pause 1
  58. output +++
  59. pause 1
  60. output \13ATH\13
  61. input 3 OK
  62. echo \13Pausing 1 minute before re-dialing.
  63. pause 60
  64. define \%d \13\10Redialing
  65. goto :REDIAL
  66.  
  67. ; -----------------------------------------------------------------------------
  68. ; Got connected, determine actual connect speed
  69. ; -----------------------------------------------------------------------------
  70. :SPEED
  71. define \%s 2400
  72. reinput 1 2400
  73. if success goto :GOTSPEED
  74. define \%s 1200
  75. reinput 0 1200
  76. if failure define \%s 300
  77. :GOTSPEED
  78. set speed \%s
  79. echo \13\10Logging in at \%s baud.
  80.  
  81. ; -----------------------------------------------------------------------------
  82. ; Respond to system prompts
  83. ; -----------------------------------------------------------------------------
  84.  
  85. pause 5
  86. :LOGIN
  87. input 60 first name                    ; Enter first name
  88. if failure errstop {No first name prompt}
  89. output \%f\13
  90.  
  91. input 10 last name                        ; Enter last name
  92. if failure errstop {No last name prompt}
  93. output \%l\13
  94.  
  95. input 10 \%f \%l                        ; Respond to name confirmation
  96. if failure errstop {No confirmation}
  97. output y\13
  98.  
  99. input 10 password                        ; Enter password
  100. if failure errstop {}
  101. output \%a\13
  102.  
  103. ; Scan through signon messages
  104. :ELOOP
  105. input 10 enter
  106. if failure goto :LISTMESS
  107. output \13
  108. goto :ELOOP
  109.  
  110. :LISTMESS
  111. reinput 5 Select                        ; Go to message section
  112. if failure errrstop {}
  113. output m\13
  114.  
  115. input 10 message number                ; Go to message section a2
  116. if failure errstop {}
  117. output a2\13
  118.  
  119. input 10 message number                ; List all new messages
  120. if failure errstop {}
  121. output =\13
  122.  
  123. ; Wait for all messages to be listed
  124. :READLOOP
  125. input 10 message number
  126. if failure goto :READLOOP
  127.  
  128. output g\13                            ; Sign off
  129. input 2 disconnect
  130. if failure errstop {}
  131. output y\13
  132. input 2 leave a note
  133. if failure errstop {}
  134. output n\13
  135.  
  136. :LOGOFF
  137. echo \13Forcing hangup...\13\10
  138. pause 1
  139. output +++
  140. pause 1
  141. output \13ATH\13
  142. input 3 OK
  143. exit
  144.  
  145.  
  146.