home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
152
/
HSLMAIL2.ZIP
/
HSLMAIL2.SCR
< prev
next >
Wrap
Text File
|
1993-09-07
|
16KB
|
463 lines
; HSLMAIL2.SCR
; This script may be used *only* with QmodemPro for
; unattended mail transfers from Tomcat on Wildcat! BBSs which
; support Sam Smith's HSLINK file transfer protocol. Echo mail
; discussions are available via the RIME network in Conference #
; 37 on the DRS BBS.
; This is the bulldog version of DRSMAIL7.SCR - I called it a
; "bulldog" because once engaged this script will repeatedly call
; the BBS even though it is aborted by timeouts, bad connections,
; or crashed BBSs
; Copy it to your SCRIPTS subdirectory but do not link it in your
; QM phone directory to a BBS entry. This script must be called
; as QmodemPro is loaded with the DOS command string
; QMPRO /S=HSLMAIL1.SCR using the batch file named QMPHSL.BAT
; which is included here.
; HSLINK must be installed as an External File Transfer Protocol
; in QmodemPro. Instructions for installing an External
; FTP are contained in the documentation files accompanying
; QmodemPro and will not be repeated here.
; The basic batch files used are named HSLDWN.BAT and HSLUP.BAT
; and are included in this ZIP. Two additional batch files named
; HSLDWNF.BAT and HSLUPF.BAT are also included which may be used
; under optimal line conditions with MNP modems to increase the
; speed of transfers. Note that you must use a text editor to
; insert the *download* path for your own system in these files;
; just *replace* F:\QMP\DOWNLOAD with your own path (do not remove
; the -U switch as that identifies this path to HSLINK)
; Since HSLINK will not auto-increment filenames on its own this
; script will rename $BBSID.QWK while loading to avoid any later
; filename conflict.
;
; For DRS BBS, your download directory is checked for a file named
; CTDRS.QWK and if found, the script will rename it using a numeral
; read from the file RENDAT.NUM (which the script itself will
; create the first time it is executed). HSLINK will then be able
; to download a new file named CTDRS.QWK without overwriting
; anything. If no file named CTDRS.QWK is found in your download
; directory the script will continue without renaming anything.
; HSLMAIL2.SCR then will prompt you for a starting time after
; that's entered then wait until that start time arrives
; before continuing. This permits you to easily change the
; time at which an unattended mail transfer is started from day to
; day.
; You are required to insert values for the variables USER,
; PASS, BBSID, BBSNUM, LIMIT, and PREFIX to suit your system
; and to be sure that QmodemPro is correctly configured
; as described below. The value presently assigned to
; BBSNUM is that of the DRS BBS but if you want to
; use this same script for calling some other Wildcat BBS just
; make the appropriate variable changes (and change the name of
; the script to avoid confusing the *.BAT programs).
;===== This script is written to take advantage of the ability of
;===== HSLINK to Auto-start. The Auto Download string must be entered
;===== in the field provided in Alt-N/C/P/E of QmodemPro. This
;===== string is HS*^BR.
;===== Also, *both* Download Batch and Upload Batch fields must
;===== be toggled to Y since a QMPRO.BEW file is used to direct
;===== the transfer of files. The UPLOAD command in the script
;===== will then cause QmodemPro to write the $REPPATH$BBSID.REP
;===== to QMPRO.BEW and that specifies the file to be uploaded
;===== which HSLINK will substitute for the %4 replaceable
;===== paramter in HSLUP.BAT. These same batch files may be used
;===== for file transfers other than QWK/REP packets in the usual
;===== way.
;===== Check to be sure that you have QmodemPro configured so it
;===== will not save partial files.
;===== The BBS you call must support HSLINK or you cannot use it
;===== there. For maximum flexibility you may wish to go to Your
;===== Settings in the Main Menu of your Wildcat BBS and set
;===== Transfer Protocol to SELECT. This script will then select
;===== HSLINK just before the transfer. Alternatively, you must
;===== set Transfer Protocol to HSLINK or this script will derail
;===== as the BBS attempts a transfer with some other protocol you
;===== may have chosen as the default.
;===== When you are satisfied that HSLMAIL1.SCR is running
;===== correctly on your system, you may wish to remove all the
;===== Comments I've included here.
;===================== User Variables ===============================
String BEW BBSID BBSNUM LIMIT PASS PADONE PADTWO PREFX QMDIR RENDAT USER
Assign USER "Karl Hakmiller" ;Insert your name - may not use
;$USERID variable in an unlinked
;script; space in name requires
;enclosing quotation marks.
Assign PASS "xxxxx" ;Insert your password on the BBS
;and be certain you remove it
;before sharing the script.
Assign BBSID CTDRS ;Insert the packet name for the
;BBS you are calling
Assign BBSNUM 297-5907 ;Insert the phone number of the
;BBS being called; if spaces are
;used in the number enclose the
;whole number in double-quotes.
Assign LIMIT 600 ;The BBS SysOp will have
;assigned a limit on the number
;of messages Tomcat will add to
;your packet following each DL
;command. I have written this
;script so that it will make
;REPEATED download passes if you
;reach the Message Limit that
;has been set for you - with the
;result you will receive all of
;your new mail providing only
;that your access level allots
;you enough on-line time. You'll
;see the limit allotted you on
;the screen when Tomcat runs the
;first time and you can change
;this variable accordingly.
Assign PREFX ATDT ;Replace ATDT with ATDP is you
;are calling on a PULSE (Rotary
;Dial) line. ATDT is for a TONE
;line.
Assign QMDIR F:\QMP\ ;Your QmodemPro home directory
;========================= No further changes required ===============
; This next section manages the renaming of a QWK packet which
; might cause a filename conflict on download.
Assign RENDAT RENDAT.NUM ;Name of file - RENDAT.DAT - in
;your QMDIR containing the
;numeral which will be used to
;rename your QWK packets to
;prevent overwriting.
Assign PADTWO 00 ;Left pad for RENDAT numerals
;less than 10
Assign PADONE 0 ;Left pad numerals 10-99
Assign BEW "$BBSID.REP"
Assign 0 00:00:00 ;Reset starting time to 00:00:00
Assign 1 0 ;Counter for RING attempts
Assign 2 0 ;Counter for BULLDOG calls
Assign 3 0 ;Counter for BUSTOUT calls
Assign 4 0 ;Variable containing numeral 001-998
Assign 5 0 ;Variable containing CONNECT speed
EXIST $QMDIR$RENDAT OPEN1 ;Goes to OPEN1 if RENDAT.NUM already exists
Openfile $QMDIR$RENDAT Rewrite ;Creates the file RENDAT.NUM if not there
Assign 4 1
Writefile 4 1 ;Writes the numeral 1 to the RENDAT.NUM file
Closefile
OPEN1:
Openfile $QMDIR$RENDAT Read
Readfile 4 ;Reads RENDAT.NUM content as integer value.
Incr 4 ;Adds 1 to numeral found in RENDAT.NUM
If "$4" >= "998" RESETIT ;Tests for limit of RENDAT numeral.
If "$4" <= "9" PAD2 ;Left pads 1-9 with 00
If "$4" <= "99" PAD1 ;Left pads 10-99 with 0
Closefile
Goto OPEN2
RESETIT:
Closefile
Openfile $QMDIR$RENDAT Rewrite
Assign 4 1 ;Resets $4 (998) to 1.
Writefile 4 ;Writes $4 to RENDAT.NUM.
Closefile
Goto OPEN1
PAD2: ;Pads RENDAT numerals < 10 with left 00.
Closefile
Openfile $QMDIR$RENDAT Rewrite
Assign 4 "$PADTWO$4" ;Resets $4 (n < 10) to 00n).
Writefile $4 ;Writes 00n to RENDAT.NUM.
Closefile
Goto CHECKDUP
PAD1: ;Pads RENDAT numerals 10-99 with left 0
Closefile
Openfile $QMDIR$RENDAT Rewrite
Assign 4 "$PADONE$4" ;Resets $4 (n 10-99 ) to 0n).
Writefile $4 ;Writes 0n to RENDAT.NUM.
Closefile
Goto CHECKDUP
OPEN2:
Closefile
Openfile $QMDIR$RENDAT Rewrite
Writefile $4
Closefile
CHECKDUP:
EXIST $QWKPATH$BBSID.QWK RENAMEIT
Goto RUNTIME
RENAMEIT:
DisplayLn "Found CTDRS.QWK - renaming to avoid conflicting filenames"
Pause 2000
DOS "RENAME $QWKPATH$BBSID.QWK $BBSID$4.QWK" ;Renames old packet
;with next numeral in
;RENDAT.NUM
;This next section prompts the user for a starting time
RUNTIME:
DisplayLn "Current system time is $TIME"
DisplayLn "----------------------------"
Display "Enter hh:mm:ss starting time: "
Getn 0 8 ;GETN will accept 8 chars
;from the keyboard
;and assign them to
;the variable $0
DisplayLn "You entered $0"
DisplayLn "Script will begin to run at $0"
WAITUNTIL $0
;The QWK/REP transfer script follows
TIPTOP:
TurnON ONLINE
TurnON 8_BIT
TurnOFF LINEFEED
TurnOFF XON/XOFF
TurnON NOISE
TurnOFF MUSIC
TurnON SCROLL
TurnOff PRINT
TurnOff SPLIT
TurnOn STATUSLN
TurnOFF DOORWAY
Capture $DATE.HSL
LOG MAIL.LOG ;Start a log running.
Stamp LOG started on $DATE at $TIME
LOOP1:
Timeout 70 WARN :Set Timeout at 70 seconds
Pause 500 ;Pause between dial attempts
When
Incr 1
DisplayLn " ...Trying RING #$1 "
When "BUSY" LOOP1
When "VOICE" LOOP1
When "NO CARRIER" LOOP1
When "2400/ARQ" BULLDOG
When "9600/V32" BULLDOG
When "?~?~?~?~?" BULLDOG
Send "$PREFX$BBSNUM^M"
Pause 500
Waitfor "Connected at "
Getx 5 4 b
DisplayLn " Normal CONNECT has been made at $5 baud."
Delay 500
Stamp Normal CONNECT in $1 attempts on $DATE at $TIME
Stamp Connected at $5 baud
Clrscr
Color 31
TOP:
Timeout 70 BULLDOG
When
When "9600/V32" BULLDOG ;Reject a non-HST link
When "incorrectly" REPEAT ;Sent name incorrectly, try again
When "Wrong" "$PASS^M" ;Sent password incorrectly
When "NO CARRIER" BULLDOG
Waitfor "first name" ;This is the Fast Login route to
Delay 100 ;the Tomcat Mail Door (!). It skips
Send "!$USER $PASS^M" ;opening Bulletins/Newsletters/Menus
TOMMY:
Flush COM
Timeout 70 BULLDOG
When
When "Qmodem Host Command" BBSDOWN ;QM HOST may be up when BBS is down
When "top?" "C^M"
Waitfor "TOMCAT MENU [D U"
Delay 200
Send "D^M" ;Begin Download Mode
Delay 100
Timeout 600 BULLDOG
When
When "NO CARRIER" BULLDOG
When "Total messages found: $LIMIT" PUSHMORE ;More mail possible
When "Nothing found to download" CHEKREP
CONT1:
When "done?" "Y^M" ;Accept download
When "PROTOCOL MENU" "H^M" ;Select HS/LINK
Waitfor "Start" ;Begin transfer
Delay 100
Upload H $REPPATH$BBSID.REP ;Note that the HSLINK
;*upload* batch file will
;be called but the
;download will also be
;done by HSLINK
MOREMAIL:
Pop 4 ;Take $4 from stack
If "$4" = "MORE" TOMMY ;Go for more mail
If $SUCCESS SCRUBREP ;Delete uploaded REP file
Goto GETOUT
CHEKREP:
Exist $REPPATH$BBSID.REP DOUP
Goto GETOUT
DOUP:
Timeout 60 ABORT
Waitfor "TOMCAT MENU [D U"
Send "U^M"
Timeout 60 ABORT
When "PROTOCOL MENU" "H^M" ;Select HS/LINK
Waitfor "Start"
Delay 100
Upload H $REPPATH$BBSID.REP
If $SUCCESS SCRUBREP ;Delete uploaded REP file
Goto GETOUT
REPEAT:
Send "N^M"
Delay 100
Send "^M"
Stamp Incorrect Name/Password on $DATE at $TIME
Goto TOP
WARN:
Color 15
Clrscr
Note Timed out while waiting for CONNECT.
Note This indicates that a non-standard return code was received.
Note Standard return codes: CONNECT, BUSY, VOICE, NO CARRIER, and NO DIALTONE
DisplayLn "Pausing 8 seconds before continuing to BULLDOG..."
Pause 8000
BULLDOG:
Stamp BULLDOG engaged after $1 RINGS on $DATE at $TIME
Clrscr
Incr 2
DisplayLn "Bulldog engaged - pausing 10 seconds before the next bite!"
Box 1 3 44 15
Color 46
DisplayLn " "
DisplayLn " ......... "
DisplayLn " /^) ...........(^ \ "
DisplayLn " / <_<_...._>_> \ "
DisplayLn " / /.. -.- -.- ..\ \ "
DisplayLn " | | ... ( ) ... | | "
DisplayLn " ~ ... ____ ... ~ "
DisplayLn " .... Vv-------vV.... "
DisplayLn " ................ "
DisplayLn " "
DisplayLn " "
Pause 10000
Color 14
Stamp Bulldog has now been called $2 times on $DATE ;Log message
If $ONLINE BUSTOUT
TurnOff LOG
Hangup
Gosub BIGSCRN
Clrscr
Goto TIPTOP
BUSTOUT:
Clrscr
Incr 3
Timeout 30 BULLDOG
When
When "Command >> ?" "G^M"
When "TOMCAT MENU [D U" "G^M"
When "logoff [Y]?" "Y^M"
Hangup
Waitfor "NO CARRIER"
Stamp Bustout has now been called $3 times on $DATE ;Log message
TurnOff LOG
Goto BULLDOG
PUSHMORE:
Assign 4 MORE ;Assign MORE to $4
Push $4 ;Push MORE on stack
Goto CONT1 ;Go get pending mail packet
SCRUBREP:
Deletef $REPPATH$BBSID.REP
Delay 100
Goto GETOUT
BBSDOWN:
Stamp Connected Qmodem HOST on $DATE at $TIME
Stamp Exited HOST at $TIME
TurnOff LOG
Send "G^M"
Hangup
Goto TIPTOP
GETOUT:
Timeout 30 CHECKOUT
Clrscr
Gosub BIGSCRN
Waitfor "TOMCAT MENU [D U C H G Q]:"
Delay 100
Send "G^M" ;Be polite - issue Goodbye
CHECKOUT:
Timeout 30 BAILOUT
When
When "[Y/n]?" "^M" ;Confirm logoff request
Delay 100
Waitfor "NO CARRIER"
Delay 100
Hangup ;Be sure you are offline
DisplayLn " Normal exit from script"
Delay 500
Stamp NORMAL exit on $DATE at $TIME
Stamp ================= END ==========================
TurnOff LOG
System Y ;Leave script & QM for DOS
BAILOUT:
Stamp Bailed out on $DATE at $TIME
Stamp ============== BAILED OUT =====================
TurnOff LOG
Hangup
System Y
BIGSCRN: ;This is a SUBROUTINE
Window 1 1 80 24 ;Make screen 80x24
Color 31 ;Make screen bright white on blue
Return ;Return to next script line