home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
TE2SC121.ZIP
/
MaxQWK.Scr
< prev
next >
Wrap
Text File
|
1992-07-21
|
4KB
|
150 lines
;; -------------------------------------------------------------------------
;;
;; MaxQWK.Scr -- Copyright (c) 1992, Oberon Software, Mankato Mn
;; Author: Brady Flowers, 07/19/92
;;
;; Usage: This is setup specifically for automatic upload and download
;; of QWK Packets to and from Pete Norloff's OS/2 Shareware BBS.
;; There are several ways this script could be run:
;;
;; 1. Attached to a dialing directory entry. In this case you
;; must have MaxLogin.Scr and Bink2BBS.Scr present somewhere
;; on your ScriptPath.
;;
;; 2. From the Alt-/ Command Prompt:
;; a. If you are off line, you must have MaxLogin.Scr and
;; Bink2BBS.Scr available to be run.
;; b. If you are already logged to the BBS, you MUST be sitting
;; at the BBS's "Main Menu" prompt. This is the only usage
;; that does NOT require MaxLogin.Scr and Bink2BBS.Scr.
;;
;; 3. From another script. You may want to schedule execution
;; of this script to do unattended QWK mailings via some timed
;; execution utility. To do this, you should make sure that
;; the MaxLogin.Scr and Bink2BBS.Scr files are available to
;; be executed, you should edit this file to remove the call
;; to GetYesNo() near the bottom of this file and make it such
;; that an unconditional logoff will be performed, and you
;; should create a script file that contains:
;;
;; program
;; run("MaxQWK")
;; exit(FALSE)
;; end
;;
;; Assuming that you name that script AutoQWK.Scr, your
;; TE/2 command line should look like: "te2 -mAutoQWK".
;;
;; -------------------------------------------------------------------------
string QWKInbound = "D:\PMQWK\InBound" ;; <<== Set this as appropriate
string QWKOutbound = "D:\PMQWK\OutBound" ;; <<== Set this as appropriate
string REPPacket = "OS2SHARE.REP"
string SaveDLPath
integer SaveClobber
integer SaveQZM
integer SaveXonXoff
integer fREPPacket
integer fQWKPacket
;; --------------------------------------------------------------------------
subroutine SetupQWK
SaveDLPath = DownLoadPath
SaveClobber = ClobberDL
SaveQZM = QueryZMRecover
SaveXonXoff = XonXoff
setxonxoff(0)
DownLoadPath = QWKInbound
;; Possible settings for ClobberDL:
;; -1 -> rename an existing file and continue xfer
;; 1 -> overwrite any existing file
;; 0 -> abort xfer if file exists
ClobberDL = -1
;; Set ZModem recovery OFF, it would be a real pain to have the recovery
;; menu pop up during an unattended transfer!
QueryZMRecover = FALSE
;; Discover if a .REP packet exists
REPPacket = QWKOutbound + "\" + REPPacket
fREPPacket = fopen(REPPacket, "r")
if (fREPPacket & 0x0000ffff)
fclose(fREPpacket)
fREPPacket = TRUE
else
fREPPacket = FALSE
endif
endsub
;; --------------------------------------------------------------------------
subroutine UnSetupQWK
DownLoadPath = SaveDLPath
ClobberDL = SaveClobber
QueryZMRecover = SaveQZM
setxonxoff(SaveXonXoff)
endsub
;; --------------------------------------------------------------------------
subroutine QWKXfer
if fREPPacket
transmit("ou^M")
waitfor("^Q", 300)
if upload(ZMODEM, REPPacket)
erase(REPPacket)
else
FileError("Error uploading file, aborting script! ", REPPacket)
stop
endif
waitfor("Select:", 300)
transmit("d^M")
else
transmit("od^M")
endif
fQWKPacket = muxwait("/[Y,n]?/Select:/", 300)
if fQWKPacket == 1
transmit("Y^M")
waitfor("<esc> to abort:", 300)
transmit("^M")
waitfor("cancel.", 300)
download(ZMODEM, "")
waitfor("Select:", 300)
endif
endsub
;; --------------------------------------------------------------------------
program
if !connected
run("MaxLogin")
endif
if connected
gosub SetupQWK
gosub QWKXfer
gosub UnSetupQWK
if GetYesNo("QWK Mail processing completed.", "Do you want to log off now?", TRUE)
transmit("g;y;n^M")
waitfor("Please call again!", 30)
hangup(FALSE)
endif
endif
end