home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / OFFLINE / PCB15QW1.ZIP / PCB15QWK.RS < prev   
Text File  |  1993-06-12  |  2KB  |  101 lines

  1.  
  2. TITLE "PCBoard 15.0 internal QWK/REP mail run"
  3. ;----------------------------------------------------------------------
  4. ; PCB15QWK.RS -- MAIL run for PCBoard 15 Internal QWK
  5. ;......................................................................
  6. ;
  7. ; Author:  Dan Parsons
  8. ; Version: 1.0
  9. ; Revised: 3/25/93
  10. ;
  11. ;----------------------------------------------------------------------
  12. PARAMETER 1 "Alternate BBS/QWK ID     (8 chars max)"
  13. PARAMETER 2 "Alternate QWK dir (include ending '\')"
  14. PARAMETER 3 "Alternate REP dir (include ending '\')"
  15. PARAMETER 4 "Hang up after sending REP        (Y/N)"
  16. PARAMETER 5 "Mail run log file           (optional)"
  17. ENDPARAMS
  18.  
  19.     ; Verify that the 3 necessary parameters were entered.
  20.     IF EMPTY "%P1%" GOTO PARAM_ERROR
  21.     IF EMPTY "%P2%" GOTO PARAM_ERROR
  22.     IF EMPTY "%P3%" GOTO PARAM_ERROR
  23.  
  24.     ; Set up capture file
  25.     ; Change "overwrite" below to "append" if desired.
  26.     IF NOT EMPTY "%P5%" CAPTURE "%P5%" APPEND
  27.  
  28.     ; Default to ten minutes to scan for mail.
  29.     ; Edit this if desired.
  30.     TIMEOUT 600
  31.  
  32.     ; Get to mail door
  33.     VENUE MAIN
  34.     JOIN "0"
  35.  
  36.     ; Request the packet
  37.     SEND "QWK D|"
  38.  
  39.     WHEN "%BBS32%" SEND "|"
  40.     WHEN "%BBS34%" SEND "|"
  41.     WHEN "NOTHING TO DOWN" GOTO NOQWK
  42.     WAITFOR "%BBS39%" FAILURE GOTO SLOW_BBS
  43.  
  44.     ; Keep 3 old QWK packets by default.
  45.     ; Edit this if desired.
  46.     IF EXIST "%P2%%P1%.QWK" RENUMBER "%P2%%P1%.QWK" 3
  47.  
  48.     ; Download the QWK packet.
  49.     MESSAGE "Downloading %P2%%P1%.QWK"
  50.     DOWNLOAD "%P2%%P1%.QWK" USING "%BBS22%"
  51.     
  52. GOTO SENDREP
  53.  
  54. :NOQWK
  55.     MESSAGE "No mail to download."
  56.     GOTO SENDREP
  57.  
  58. :SENDREP
  59.     IF NOT EXIST "%P3%%P1%.REP" GOTO NOREP
  60.     SEND "QWK U|"
  61.     WAITFOR "%BBS39%" FAILURE GOTO I_AM_LOST
  62.     MESSAGE "Uploading %P3%%P1%.REP"
  63.     UPLOAD "%P3%%P1%.REP" USING "%BBS21%"
  64.     ; Will keep up to 3 old rep packets.  Edit if desired.
  65.     RENUMBER "%P3%%P1%.REP" 2
  66. GOTO ENDRUN
  67.  
  68. :NOREP
  69.     MESSAGE "No %P3%%P1%.REP to send"
  70. GOTO ENDRUN
  71.  
  72. :ENDRUN
  73.     IF YES "%P5%" GOTO DROP_CARRIER
  74.     CLOSE
  75. EXIT 0
  76.  
  77. :DROP_CARRIER
  78.     MESSAGE "Dropping carrier per request"
  79.     HANGUP
  80.     CLOSE
  81. EXIT 0
  82.  
  83. :SLOW_BBS
  84.     MESSAGE "^UERROR:^U Timeout during mail run."
  85.     HANGUP
  86.     CLOSE
  87. EXIT 1
  88.  
  89. :I_AM_LOST
  90.     MESSAGE "^UERROR:^U Sorry - I am lost."
  91.     HANGUP
  92.     CLOSE
  93. EXIT 1
  94.  
  95. :PARAM_ERROR
  96.     MESSAGE "^UERROR:^U Parameters 1, 2 and 3 are required!"
  97.     CLOSE
  98. EXIT 1
  99.  
  100. ;eof
  101.