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

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