home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / qns311.zip / Q-QM4.SCR < prev    next >
Text File  |  1991-02-19  |  4KB  |  77 lines

  1. ;┌──────────────────────────────────────────────────────────────────────────┐
  2. ;│ Q-QM4.SCR          Copyright 1988-1991 by Rik Brown                      │
  3. ;│                                                                          │
  4. ;│                    Qmail 4.x door script                                 │
  5. ;└──────────────────────────────────────────────────────────────────────────┘
  6.  
  7.   IF "$4" = "$maxulmail"         LOGOFF ; Counter check: ul attempts
  8.   IF "$3" = "$maxdlmail"         LOGOFF ; Counter check: dl attempts
  9.  
  10.   SEND "^~OPEN $maildoor^M"             ; Open door
  11.   WHEN                                  ; Clear all WHENs
  12.   WHEN "(NS)?" "^~N^M"
  13.   WHEN "upcoming board function" LOGOFF ; Logoff if event is non-sliding
  14.   TIMEOUT 40                CARRIERDROP ; Wait max 40 secs for next line
  15.   WAITFOR "ommand?"
  16.  
  17. ULMAIL:
  18.  
  19.   WHEN
  20.   WHEN "NO CARRIER"         CARRIERDROP ; Error handling (carrier loss)
  21.   EXIST $maildir\success.SND     DLMAIL ; Error handling (carrier loss)
  22.   IF "$2" = "0"                  DLMAIL ; Download .QWK if no .REP to send
  23.  
  24.   INCR 4                                ; Increment ULMAIL counter
  25.   SEND "^~^M"                           ; Get "command" prompt
  26.   TIMEOUT 10                     DLMAIL ; Online test (grab command prompt)
  27.   WAITFOR "ommand?"
  28.   SEND "^~U^M"                          ; Upload current .REP packet
  29.   TIMEOUT 60                CARRIERDROP ; Wait max 60 seconds for ready
  30.   WAITFOR "Prepare to upload"           ; MarkMail door is read to receive
  31.   PAUSE 1000                            ; Pause 1 sec (or overrun next cmd)
  32.   DOS "qnssz.bat $maildir $mailUL"      ; Call transfer BAT file
  33.   IF $OFFLINE               CARRIERDROP ; Error handling (carrier loss)
  34.   PAUSE 1000
  35.   DOS "if exist $maildir\success.SND del $maildir\$mailUL"
  36. ; If mail upload was successful, it will be deleted. But if mail upload
  37. ; failed, it will be uploaded the next time the script is run. In this
  38. ; way no replies are lost. Pending mail files must be successfully uploaded
  39. ; before a totally new mail file can be created.
  40.   CLRSCR                                ; Exit DSZ status line
  41.   EXIST $maildir\success.SND     DLMAIL ; Set to your location
  42.   PAUSE 6000                            ; 6 sec pause for door to recycle
  43.   GOTO ULMAIL
  44.  
  45. DLMAIL:
  46.  
  47.   WHEN
  48.   WHEN "NO CARRIER"         CARRIERDROP ; Error handling (carrier loss)
  49.   WHEN "no messages were found"  LOGOFF ; Skip download if no mail is found
  50.   WHEN "these messages" "^~^~Y^M"       ; Download the packet
  51.   WHEN "unsuccessful"            DLMAIL ; Try again if error
  52.   EXIST $maildir\success.RCV     LOGOFF ; Error handling (prior carrier loss)
  53.   IF "$3" = "$maxdlmail"         LOGOFF ; Counter check: dl attempts
  54.   INCR 3                                ; Increment DLMAIL counter
  55.   SEND "^~^M"                           ; Get "command" prompt
  56.   TIMEOUT 60                     LOGOFF ; Keep large
  57.   WAITFOR "ommand?"
  58.   SEND "^~D^M"                          ; Download .QWK packet
  59.   TIMEOUT 2000              CARRIERDROP ; Wait max 20 minutes for .QWK
  60.   WAITFOR "Prepare to download"         ; Wait for file to compress
  61.   PAUSE 1000                            ; Pause 1 sec (or overrun next cmd)
  62.   DOS "if exist $maildir\$mailDL del $maildir\$mailDL"
  63. ; Delete any prior non-completed Zmodem download of a .QWK file
  64.   DOS "qnsrz.bat $maildir $mailDL"      ; Call transfer BAT file
  65.   IF $OFFLINE               CARRIERDROP ; Error handling (carrier loss)
  66.   SEND "~~^M"                           ; Press any key to continue
  67.   CLRSCR                                ; Exit DSZ status line
  68.   EXIST $maildir\success.RCV     LOGOFF ; Log off is DL successful
  69.   PAUSE 10000                           ; 10 sec pause for door to cycle
  70.   GOTO                           DLMAIL ; Try again if unsuccessful
  71.   RETURN                                ; Exit mail routine
  72.  
  73. CARRIERDROP:
  74.   SCRIPT $CMDSCRIPT
  75. LOGOFF:
  76.   SCRIPT Q-LOGOFF.SCR
  77.