home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
comm
/
q4rly20.zip
/
Q4RLY.SCR
< prev
next >
Wrap
Text File
|
1989-04-04
|
11KB
|
308 lines
;--------------------------------------------------------------------------;
; Q4RLY.SCR ;
; version 2.00
; A very easy to use Qmodem script for PCRelay mail transfers ;
; ;
; (c) Copyright 1988, 1989 by Robert B. Browne ; ;
; ;
; This script is provided for those PCRelay sysops who wish to ;
; run their mail transfers in unattended mode, but do not have ;
; the time or inclination to write their own script. Q4Relay is ;
; a general purpose Relay script with enough error checking to ;
; prevent it from hanging, and features an easy 'fill in the blank' ;
; data area for ease of set-up. Just fill in the proper values below ;
; after reading the Q4RLY.DOC file) and you'll be on your way. ;
; ;
; Good luck ;
; ---[ Bob ]--- ;
; ;
;--------------------------------------------------------------------------;
STRING NAME DOOR NODEID PATH INIT ; set up special variables
STRING TYPE PHONE PWRD HUB DIALS WAIT
STRING PROT CALLERS
ASSIGN PROT "R" ; set the protocol. If the protocol
; is external, it MUST be defined in
; Qmodem install routine <ALT>N
ASSIGN PWRD "xxxxxxxx" ; you must set this variable if
; using TYPE MAN
ASSIGN NAME "BOB BROWNE" ; your name goes here
ASSIGN DOOR "25" ; the door number for you hub here
ASSIGN NODEID "SOLUTION" ; your node id goes here
ASSIGN HUB "HUBNY1" ; ID code for your HUB
ASSIGN PATH "E:\Q4\RELAY" ; path to IN.RLY and outgoing packet
; DO NOT use a trailing backslash
ASSIGN INIT "H" ; modem init string null if none used
; * NOTE: If your modem defaults
; to MNP ON, and your HUB does not
; have an MNP modem, then you MUST
; put the MNP OFF command here.
; otherwise, the script will never
; see the CONNECT message from
; PCBOARD (which is used to
; determine if we have a baud rate
; match) and the script will keep
; recycling.
ASSIGN TYPE "MAN" ; type is MAN or DIR
; - if type MAN then put the
; actual telephone number of the
; hub in PHONE, if type DIR then put
; the number of the dialing directory
; record in PHONE
ASSIGN PHONE "x-xxx-xxx-xxxx" ; your hub's dialing directory number
; or telephone number depending on TYPE.
; MAKE SURE YOUR PASSWORD IS IN THE
; DIALING DIRECTORY IF YOU USE TYPE
; 'DIR'
ASSIGN DIALS 60 ; Maximum number of dial attempts if
; using TYPE MAN.
ASSIGN WAIT 5000 ; Number of milliseconds to wait
; between re-dial attempts when
; using type MAN. 1000=1 second.
; recommended value is 5000 for a
; 5 second re-dial pause. This
; will prevent your HUB from getting
; stuck with continuous modem reset
; errors
ASSIGN 9 0 ; these are loop counter variables
; DO NOT change these values
ASSIGN CALLERS 0
;----------------------------------------------------------------------------
;
; MAKE SURE YOU FILL IN ALL YOUR DATA ABOVE !!!!!
;
;----------------------------------------------------------------------------
INITIALIZE:
IF '$0' = '' INITIALIZE1
SETCOMM $0
INITIALIZE1:
PAUSE 1000
TIMEOUT 5 INITIALIZE2
INITIALIZE2:
SEND "AT$INIT^M"
WAITFOR "OK"
START:
IF '$TYPE' = 'MAN' MANUAL
IF '$TYPE' = 'DIR' DIRECTORY
DISPLAYLN "Uknown dial TYPE specified"
STAMP Unknown dial TYPE specified......Aborting at $TIME on $DATE
GOTO NORMALOUT
MANUAL:
WHEN "NO CARRIER" MANUAL2
TIMEOUT 60 MANUAL2 ; 60 = number of seconds to wait for
WHEN "BUSY" MANUAL2 ; carrier. It's better if you leave
WHEN "NO DIAL TONE" MANUAL2 ; this set this way, and set your modem
WHEN "VOICE" MANUAL2 ; to timoute 30 or 45 - this way the
; loop is driven by the WHEN statement
; instead of the TIMEOUT.
ASSIGN 2 $DIALS
INCR 2
WHEN "RING" INCOMING
MANUAL1:
GOSUB CONFIG_WINDOW
COLOR 11
BOX 31,1,80,7
ATWRITE 33 1 11 "[ Manual Dialing - $DIALS attempts ]"
WINDOW 33,2,79,6
COLOR 3
MANUAL2:
INCR 9
IF '$9' = '1' NO_WAIT
IF '$9' = '$2' NO_ANSWER
DISPLAYLN " "
DISPLAY "Pausing $WAIT milliseconds for Re-Dial"
PAUSE $WAIT
NO_WAIT:
CLRSCR
IF '$9' = '1' NO_CR
DISPLAYLN "Dial attempt # $9 of $DIALS"
GOTO CR
NO_CR:
DISPLAY "Dial attempt # $9 of $DIALS"
CR:
SEND "ATDT$PHONE^M"
WAITFOR "CONNECT"
GOTO PICKUP
DIRECTORY:
GOSUB CONFIG_WINDOW
PAUSE 2000
DIAL "$PHONE"
GOTO PICKUP
PICKUP:
WINDOW 1,1,80,24
CLRSCR
COLOR 13
WHEN
PICKUP2:
WHEN "NO CARRIER" BADCONNECT
TIMEOUT 5 BADCONNECT
WAITFOR "CONNECT" ; this is waiting for the CONNECT
; message from PCBoard. If found it
; ensures that we are connected at the
; proper baud rate and aren't getting
; too much line noise yet.
CONTINUE:
WHEN
WHEN 'NO CARRIER' CARRIER_LOSS
TIMEOUT 30 ABORT
When "name?" "$NAME^M"
IF '$TYPE' = 'MAN' MAN_PWRD
When 'echo)?' "$PASSWORD^M"
GOTO CONT2
MAN_PWRD:
When "echo)?" "$PWRD^M"
CONT2:
When "(Enter) to continue?" "^M"
When "no change" "^M"
When "=yes?" "N^M"
When "=no?" "N Q NS $NODEID^M"
WHEN "(Y), (N), (NS)?" "N^M"
When "More?" "N^M"
WHEN "non-stop" "N^M"
WAITFOR "Command?"
When
ImOn:
Beep 1200
Beep 1400
ToNormal:
TIMEOUT 240 ABORT
Send "OPEN $DOOR^M"
PAUSE 1000
DISPLAYLN " "
Display "Connected to: "
IF '$TYPE' = 'MAN' DISP2
Displayln "$BOARD ($HUB) for a RelayNet(TM) Transmission."
GOTO DISP_CONT
DISP2:
Displayln "$HUB for a RelayNet(TM) Transmission."
DISPLAYLN " "
GETSCR
DISP_CONT:
WAITFOR '*'
UPLOAD $PROT $PATH\$NODEID.RLY
PAUSE 500 ; 1/2 second pause to let receive buffer clear
WAITFOR '*'
DOWNLOAD $PROT $PATH\IN.RLY
WHEN 'NO CARRIER' NORMALOUT
PUTSCR
Waitfor 'Command?'
SEND "G^M"
Waitfor 'NO CARRIER'
GOTO NORMALOUT
BADCONNECT:
CLRSCR
TIMEOUT 5 BADCONNECT2
DISPLAYLN "Bad connection with $HUB - RECOVERING..."
STAMP $TIME - $DATE - Bad connection with $HUB - RECOVERING...
BADCONNECT2:
HANGUP
IF '$TYPE' = 'MAN' MANUAL1
IF '$TYPE' = 'DIR' DIRECTORY
CARRIER_LOSS:
HANGUP
STAMP Aborting Relay transfer due to loss of carrier with $HUB at $TIME on $DATE
DISPLAYLN "Aborting Relay transfer due to loss of carrier with $HUB at $TIME on $DATE"
GOTO NORMALOUT
ABORT:
HANGUP
STAMP ABORTING RELAY TRANSFER AT $TIME ON $DATE DUE TO TIMEOUT ON $HUB
DISPLAYLN "Aborting Relay transfer at $Time on $Date due to timeout on $HUB"
GOTO NORMALOUT
NO_ANSWER:
STAMP $HUB failed to answer after $DIALS attempts at $TIME on $DATE
DISPLAYLN "$HUB failed to answer after $DIALS attempts at $TIME on $DATE"
NORMALOUT:
EXIST SP.ERR SEND_LOG
GOTO SKIP_S
SEND_LOG:
STAMP DSZ Reports error on RelayNet(tm) upload at $TIME on $DATE
SKIP_S:
EXIST RP.ERR RECV_LOG
GOTO SKIP_R
RECV_LOG:
STAMP DSZ Reports error on RelayNet(tm) download at $TIME on $DATE
SKIP_R:
TIMEOUT 10 OUTAGAIN
OUTAGAIN:
PAUSE 500
SEND "ATM0H1^M"
WAITFOR "OK"
TURNOFF CAPTURE
IF '$CALLERS' = '0' FINALOUT
STAMP Mail script completed on $DATE at $TIME was interrupted by $CALLERS callers
FINALOUT:
SYSTEM X
INCOMING:
INCR CALLERS
SEND "ATA^M"
WAITFOR "CONNECT"
SEND "The board is currently attempting to dial out^M^J"
SEND "for a RelayNet(tm) mail transfer. Please call^M^J"
SEND "back in 30 minutes. Your patience is appreciated.^M^J"
SEND "^M^J"
PAUSE 5000
HANGUP
GOTO MANUAL2
CONFIG_WINDOW:
WINDOW 1,1,80,24
CLRSCR
COLOR 11
BOX 1,1,30,15
ATWRITE 3 1 11 "[ Configuration ]"
COLOR 3
WINDOW 3,3,29,14
DISPLAYLN "Name: $NAME"
DISPLAYLN "Door: $DOOR"
DISPLAYLN "NODEID: $NODEID"
DISPLAYLN "Path: $PATH"
DISPLAYLN "Init: $INIT"
DISPLAYLN "Type: $TYPE"
DISPLAYLN "Phone: $PHONE"
DISPLAYLN "PWRD: $PWRD"
DISPLAYLN "HUB: $HUB"
DISPLAYLN "Dials: $DIALS"
DISPLAY "WAIT: $WAIT"
RETURN