home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / AUTOPO.ZIP / POSTREP.ASP < prev    next >
Text File  |  1991-08-28  |  7KB  |  143 lines

  1. ;POSTREP.ASP  IBM EEP BBS posting script for automatically dialing,
  2. ;logging in, and posting reply messages generated from READBBS.CMD
  3. ;as modified for REPnnnnn.m naming convention where nnnnn is the message
  4. ;number and m is the message base
  5. ;Public Domain....by Don Babcock Jr. P.E.  8/91
  6. proc main
  7. set baudrate 2400
  8. init n1 4                       ;initialize a retry variable for 3 tries
  9. start:                          ;retry label
  10. dec n1                          ;decrement retry counter
  11. if zero n1                      ;if expired execute another scrip
  12.         execute "postrep"       ;in this case, retry this one indefinitely
  13. endif
  14. hangup                          ;hangup the line
  15.         transmit "AT^M"         ;have we got a live modem?
  16. waitfor "OK" 4
  17. if not waitfor                  ;if not start over
  18.      GOTO start
  19. endif
  20. transmit "ATZ^M"                ;reset modem
  21. pause 1                         ;wait a second
  22. transmit "ATV1^M"               ;set up verbal result codes level 1
  23. waitfor "OK" 4                  ;ack
  24. if not waitfor                  ;not ack-ed, start over
  25.     GOTO start
  26. endif
  27. pause 1                         ;wait a second
  28. transmit "ATX6^M"               ;set up response level
  29. waitfor "OK"
  30. if not waitfor                  ;if not set up start over
  31.     GOTO start
  32. endif
  33. pause 1                         ;wait a second
  34. transmit "ATDT9,18004263389^M"  ;dial the IBM EEP BBS
  35. waitfor "CONNECT 2400" 60       ;wait for a connection
  36. if not waitfor                  ;if we didn't get it start over
  37.     GOTO start
  38. endif
  39. pause 1                         ;wait a second
  40. waitfor "First Name ->" 60      ;wait for login prompt
  41. if not waitfor                 
  42.          GOTO start             ;didn't get it, start over
  43. endif
  44. pause 1                         ;wait a second
  45. transmit "Don^M"                ;send first name
  46. waitfor "Last Name ->" 60       ;wait for login prompt
  47. if not waitfor
  48.          GOTO start             ;didn't get it, start over
  49. endif
  50. pause 1                         ;wait a second
  51. transmit "Babcock^M"            ;send last name
  52. waitfor "(Not Displayed) ->" 60 ;wait for password prompt
  53. if not waitfor
  54.          GOTO start             ;didn't get it, start over
  55. endif
  56. pause 1
  57. transmit "(your password)^M"    ;send password
  58. waitfor "ontinue?" 60           ;wait for next prompt
  59. transmit "^M"                   ;send a carriage return (CARET)
  60. waitfor "execute ?" 60          ;waitfor BBS command prompt
  61. string msgbase                  ;initialize string variable for message base file name
  62. string msg                      ;initialize string varialbe for message number
  63. integer another=0               ;initialize another file flag
  64. findfirst "rep?????.?"          ;search for files using wildcard
  65. if found                        ;we found at least 1
  66.    another = 1                  ;set flag to look for another
  67.    when 0 "[N]o?" transmit "N"  ;set up when condition to handle messages longer than 1 screen
  68.                                 ;by sending a CARET when prompted for more
  69.    assign msgbase $FEXT         ;parse the message base from the file extension
  70.    strcmp msgbase "7" 1         ;if it is message base 7 map it to 20
  71.    if SUCCESS
  72.       assign msgbase "20"
  73.    endif
  74.    substr msg $FNAME 3 5        ;parse the message number from REPnnnnn
  75.    transmit "J "                ;send J [message base] <CR> to join
  76.    transmit msgbase             ;the appropriate message base
  77.    transmit "^M"
  78.    waitfor "execute ?" 60       ;wait for the command prompt
  79.    transmit "R "                ;send R [msg] <CR> to read the message
  80.    transmit msg                 ;that we wish to reply to.
  81.    transmit "^M"
  82.    waitfor "Read message(s)?" 120       ;wait for the sub-command prompt
  83.    transmit "R^M"                       ;transmit R <CR> to reply.
  84.    transmit "^M"                        ;Accept the next 5 default responses
  85.    transmit "^M"
  86.    transmit "^M"
  87.    transmit "^M"
  88.    transmit "^M"
  89.    waitfor "1]" 180             ;wait for the line input prompt
  90.    sendfile ascii $FILENAME     ;ASCII send the reply file
  91.    transmit "^M"                ;end the last line sent
  92.    transmit "^M"                ;send a blank line to get into sub-command mode
  93.    transmit "S^M"               ;send S <CR> to save the file
  94.    waitfor "Read message(s)?" 120       ;wait for the sub-command prompt
  95.    WHILE another                ;There was at least one reply file so check for
  96.       findnext                  ;another and loop until no more are found
  97.       if found                  ;we found one
  98.          assign msgbase $FEXT   
  99.          strcmp msgbase "7" 1
  100.          if SUCCESS
  101.             assign msgbase "20"
  102.      endif
  103.          strcmp msgbase "7" 1         ;if it is message base 7 map it to 20
  104.          if SUCCESS
  105.             assign msgbase "20"
  106.      endif
  107.      substr msg $FNAME 3 5        ;parse the message number from REPnnnnn
  108.          transmit "J "                ;send J [message base] <CR> to join
  109.          transmit msgbase             ;the appropriate message base
  110.      transmit "^M"
  111.          waitfor "Read message(s)?" 60        ;wait for the command prompt
  112.          transmit msg                         ;send [msg] <CR> to read the message
  113.          transmit "^M"                        ;that we wish to reply to.
  114.          waitfor "Read message(s)?" 120       ;wait for the sub-command prompt
  115.          transmit "R^M"                       ;transmit R <CR> to reply.
  116.          transmit "^M"                        ;Accept the next 5 default responses
  117.      transmit "^M"
  118.      transmit "^M"
  119.      transmit "^M"
  120.      transmit "^M"
  121.          waitfor "1]" 180             ;wait for the line input prompt
  122.          sendfile ascii $FILENAME     ;ASCII send the reply file
  123.          transmit "^M"                ;end the last line sent
  124.          transmit "^M"                ;send a blank line to get into sub-command mode
  125.          transmit "S^M"               ;send S <CR> to save the file
  126.          waitfor "Read message(s)?" 120       ;wait for the sub-command prompt
  127.       ELSE
  128.          exitwhile                    ;no more REP files found.
  129.       endif
  130.    endwhile
  131.  
  132. endif
  133. transmit "Q^M"                          ;get back to the command prompt"
  134. waitfor "execute ?"  60                 ;wait for it
  135. transmit "G^M"                          ;send G <CR> for goodbye
  136. pause 2                                 ;wait two seconds
  137. transmit "^M"                           ;transmit a CARET to speed logoff
  138. hangup                                  ;hangup the modem
  139. quit                                    ;exit PROCOMM
  140. endproc
  141.  
  142.  
  143.