home *** CD-ROM | disk | FTP | other *** search
- STRING NAME DOOR NODEID PATH INIT ; set up special variables
- STRING TYPE PHONE PWRD HUB DIALS WAIT
- STRING PROT CALLERS GARBAGE G2 ESC
- STRING LOGFILE TEXT BAUDRATE INBAUD
- STRING P1 P2 P3 P4 P5 P6 P7 P8 P9 CIRCNUM
-
- ASSIGN PROT "Z" ; set the protocol. If the protocol
- ; is external, it MUST be defined in
- ; Qmodem install routine <ALT>N
-
- ASSIGN PWRD "YOUR-PASSWORD" ; you must set this variable if
- ; using TYPE MAN
-
- ASSIGN NAME "FIRSTNAME LASTNAME" ; your name goes here
-
- ASSIGN DOOR "QWK" ; the door number for you hub here
-
- ASSIGN NODEID "HCS_BBS" ; QWK/REP id goes here for HUB you
- ; will be transfering mail with.
-
- ASSIGN HUB "HCS_BBS" ; ID code for your HUB
-
- ASSIGN PATH "C:\QMODEM\UD" ; path to QWK & REP packet
- ; The GAPNET QWK/REP dir should be
- ; both aimed at your comm prg Upload-
- ; Download directory.
- ; DO NOT use a trailing backslash
-
- ASSIGN INIT "Z" ; 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 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(s) of the
- ; hub in P1 - P9,if type DIR then put
- ; the number of the dialing directory
- ; record in PHONE
-
-
- ASSIGN P1 "1-216-273-9001" ;These are the phone numbers for
- ASSIGN P2 "1-216-273-8224" ;dialing your HUB. You may enter
- ASSIGN P3 "1-216-273-8981" ;up to 4 phone numbers for
- ASSIGN P4 "" ;circular MANual dialing.
- ASSIGN P5 "" ;the script will automatically
- ASSIGN P6 "" ;detect the presence of multiple
- ASSIGN P7 "" ;phone numbers. If you are not
- ASSIGN P8 "" ;using an entry, make sure it is
- ASSIGN P9 "" ;blank, as in ASSIGN P4 ""
- ;add 1+AreaCode if needed
-
- ASSIGN PHONE "" ; your hub's dialing directory number
- ; if you are using type DIR.
- ; IF YOU ARE USING 'DIR' TYPE
- ; DIALING THEN YOUR PASSWORD MUST
- ; BE IN THE DIALING DIRECTORY.
- ; Those using MAN dialing can
- ; leave this field blank ""
-
- ASSIGN DIALS 100 ; Maximum number of dial attempts if
- ; using TYPE MAN.
-
- ASSIGN GARBAGE 3 ; Maximum number of
- ; attempts to recover
- ; from line noise
- ; (garbage connection)
- ; set this number fairly
- ; low, as each 'garbage'
- ; connect is really a
- ; billable 10 sec. call
-
-
-
- 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 LOGFILE "" ; This is where you assign the log
- ; file you want to use. If left
- ; blank, no log file will be
- ; opened.
-
- ASSIGN BAUDRATE "38400" ; This is the standard baud rate
- ; you want the script to use for
- ; communicating with the hub. This
- ; is necessary to allow for shifting
- ; baud rates in the incoming caller
- ; routines. It is handled this way
- ; because a lot of modems cannot
- ; lock the link rate. If you are
- ; using a modem that is set to lock
- ; the link rate, set this value to 0
-
-
- ASSIGN 9 0 ; these are loop counter variables
- ASSIGN G2 0 ; DO NOT change these values
- ASSIGN CALLERS 0
- ASSIGN CIRCNUM 0
-
- ;----------------------------------------------------------------------------
- ;
- ; MAKE SURE YOU FILL IN ALL YOUR DATA ABOVE !!!!!
- ;
- ;----------------------------------------------------------------------------
- INITIALIZE:
- IF '$LOGFILE' = '' NOLOG
- LOG $LOGFILE
- NOLOG:
- STAMP RelayNet(tm) mail script started at $TIME on $DATE ****
- IF '$0' = '' INITIALIZE1
- SETCOMM $0
-
- INITIALIZE1:
- IF '$BAUDRATE' = '0' SKIP_BINIT
- DISPLAYLN 'Setting baud rate to $BAUDRATE'
- SETCOMM $BAUDRATE
- SKIP_BINIT:
- PAUSE 1000
- TIMEOUT 5 INITIALIZE2
-
- INITIALIZE2:
- SEND "AT^M"
- WAITFOR "OK"
- 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:
- TIMEOUT 60 MANUAL2 ; Number of seconds to wait for
- WHEN "RING^M" INCOMING
- WHEN "NO CARRIER^M" MANUAL2 ; carrier. It's a good idea to make
- WHEN "BUSY^M" MANUAL2 ; the timeout higher. If you keep it
- WHEN "NO DIAL TONE^M" MANUAL2 ; set this way, and set your modem
- WHEN "VOICE^M" MANUAL2 ; to timeout 30 or 45 - then the
- ; loop is driven by the WHEN statement
- ; instead of the TIMEOUT.
- ASSIGN 2 $DIALS
- INCR 2
-
- 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
- GOSUB CIRCULAR_DIAL
- IF '$9' = '1' NO_CR
- DISPLAYLN "Dial attempt # $9 of $DIALS"
- GOTO CR
- NO_CR:
- DISPLAY "Dial attempt # $9 of $DIALS"
- CR:
- ' SEND "^M"
- SEND "ATDT$PHONE^M"
- WAITFOR "CONNECT"
- GOTO PICKUP
-
- DIRECTORY:
- GOSUB CONFIG_WINDOW
- PAUSE 2000
- DIAL "$PHONE"
- GOTO PICKUP
-
- PICKUP:
- GOSUB CLEAR
- COLOR 13
-
- PICKUP2:
- TIMEOUT 10 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 60 ABORT
- When "[Enter] = Yes" "N Q NS O^M"
- When "[Enter] = No" "N Q NS O^M"
- When "Name" "$NAME $PASSWORD^M"
- IF '$TYPE' = 'MAN' MAN_PWRD
- When 'Password' "$PASSWORD^M"
- GOTO CONT2
- MAN_PWRD:
- When "Password" "$PWRD^M"
-
- CONT2:
- When "History? [Y/n] :" "N^M"
- When "display " "N^M"
- When "ontinue " "^M"
- WAITFOR "Command :"
-
- ImOn:
- Beep 1200
- Beep 1400
- Beep 1200
-
- ToNormal:
- When
- TIMEOUT 600 ABORT
- Send "$DOOR^M"
- PAUSE 1000
- DISPLAYLN " "
- Display "Connected to: "
- IF '$TYPE' = 'MAN' DISP2
- Displayln "$BOARD ($HUB) for an HCSNet(tm) Transmission."
- GOTO DISP_CONT
- DISP2:
- Displayln "$HUB for an HCSNet(tm) Transmission."
- DISPLAYLN " "
- GETSCR
-
- DISP_CONT:
- WAITFOR ']elect Forums'
- Send "U^M"
- WAITFOR '*'
- UPLOAD $PROT $PATH\$NODEID.REP
- PAUSE 500 ; 1/2 second pause to let receive buffer clear
- When "[Any Key] To Continue" "^M"
- WAITFOR ']elect Forums'
- Send "D^M"
- WAITFOR '*'
- DOWNLOAD $PROT $PATH\$NODEID.QWK
- WAITFOR ']elect Forums'
- Send "Q^M"
- WHEN 'NO CARRIER' NORMALOUT
- PUTSCR
- WAITFOR "Command :"
- SEND "G^M"
- Waitfor 'NO CARRIER'
- GOTO NORMALOUT
-
-
- BADCONNECT:
- PAUSE 1000
- CLRSCR
- INCR G2
- DISPLAYLN "Bad connection with $HUB - RECOVERING..."
- STAMP $TIME - $DATE - Bad connection with $HUB - RECOVERING...
-
- BADCONNECT2:
- HANGUP
- IF '$G2' = '$GARBAGE' BAD_ANSWER
- IF '$TYPE' = 'MAN' MANUAL1
- IF '$TYPE' = 'DIR' DIRECTORY
-
-
- CARRIER_LOSS:
- HANGUP
- GOSUB CLEAR
- STAMP Aborting transfer due to loss of carrier with $HUB at $TIME on $DATE
- DISPLAYLN "Aborting transfer due to loss of carrier with $HUB at $TIME on $DATE"
- GOTO NORMALOUT
-
- ABORT:
- HANGUP
- GOSUB CLEAR
- STAMP ABORTING RELAY TRANSFER AT $TIME ON $DATE DUE TO TIMEOUT ON $HUB
- DISPLAYLN "Aborting transfer at $Time on $Date due to timeout on $HUB"
- GOTO NORMALOUT
-
- NO_ANSWER:
- GOSUB CLEAR
- STAMP $HUB failed to answer after $DIALS attempts at $TIME on $DATE
- DISPLAYLN "$HUB failed to answer after $DIALS attempts at $TIME on $DATE"
- GOTO NORMALOUT
-
- BAD_ANSWER:
- GOSUB CLEAR
- STAMP Connected with $HUB $GARBAGE times without clean connect at $TIME on $DATE
- DISPLAYLN "Connected with $HUB $GARBAGE times without clean connect at $TIME on $DATE"
- GOTO NORMALOUT
-
- NORMALOUT:
- EXIST SP.ERR SEND_LOG
- GOTO SKIP_S
- SEND_LOG:
- STAMP DSZ Reports error on ThrobNet upload at $TIME on $DATE
- DOS "DEL SP.ERR"
- SKIP_S:
- EXIST RP.ERR RECV_LOG
- GOTO SKIP_R
- RECV_LOG:
- STAMP DSZ Reports error on ThrobNet download at $TIME on $DATE
- DOS "DEL RP.ERR"
- 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 "
- GETR INBAUD 4
- IF '$BAUDRATE' = '0' NO_SHIFT
- DISPLAYLN 'Shifting to callers baud rate - $INBAUD'
- SETCOMM $INBAUD
- NO_SHIFT:
- PAUSE 3000
- ASSIGN TEXT "^GThe board is currently attempting to dial out"
- SEND '$TEXT^M^J'
- DISPLAYLN "$TEXT"
- ASSIGN TEXT "for a HCSNet(tm) mail transfer. Please call"
- SEND '$TEXT^M^J'
- DISPLAYLN '$TEXT'
- ASSIGN TEXT "back in 30 minutes. Thank you."
- SEND '$TEXT^M^J'
- DISPLAYLN '$TEXT'
- ASSIGN TEXT ' '
- SEND '$TEXT^M^J'
- PAUSE 5000
- HANGUP
- IF '$BAUDRATE' = '0' NO_RESET
- DISPLAYLN 'Re-setting baud rate to $BAUDRATE'
- SETCOMM $BAUDRATE
-
- NO_RESET:
- SEND "AT$INIT^M"
- WAITFOR "OK"
- 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: ********"
- DISPLAYLN "HUB: $HUB"
- DISPLAYLN "Dials: $DIALS"
- DISPLAY "WAIT: $WAIT"
- RETURN
-
- CLEAR:
- WINDOW 1,1,80,24
- CLRSCR
- RETURN
-
- CIRCULAR_DIAL:
- INCR CIRCNUM
- IF '$CIRCNUM' > '9' ResetCirc
- BackFromReset:
- IF '$CIRCNUM' = '1' Stuff1
- IF '$CIRCNUM' = '2' Stuff2
- IF '$CIRCNUM' = '3' Stuff3
- IF '$CIRCNUM' = '4' Stuff4
- IF '$CIRCNUM' = '5' Stuff5
- IF '$CIRCNUM' = '6' Stuff6
- IF '$CIRCNUM' = '7' Stuff7
- IF '$CIRCNUM' = '8' Stuff8
- IF '$CIRCNUM' = '9' Stuff9
- BackFromStuff:
- ATWRITE 11 9 11 "$PHONE"
- RETURN
-
- Stuff1:
- IF '$P1' = '' ResetCirc
- ASSIGN PHONE '$P1'
- GOTO BackFromStuff
- Stuff2:
- IF '$P2' = '' ResetCirc
- ASSIGN PHONE '$P2'
- GOTO BackFromStuff
- Stuff3:
- IF '$P3' = '' ResetCirc
- ASSIGN PHONE '$P3'
- GOTO BackFromStuff
- Stuff4:
- IF '$P4' = '' ResetCirc
- ASSIGN PHONE '$P4'
- GOTO BackFromStuff
- Stuff5:
- IF '$P5' = '' ResetCirc
- ASSIGN PHONE '$P5'
- GOTO BackFromStuff
- Stuff6:
- IF '$P6' = '' ResetCirc
- ASSIGN PHONE '$P6'
- GOTO BackFromStuff
- Stuff7:
- IF '$P7' = '' ResetCirc
- ASSIGN PHONE '$P7'
- GOTO BackFromStuff
- Stuff8:
- IF '$P8' = '' ResetCirc
- ASSIGN PHONE '$P8'
- GOTO BackFromStuff
- Stuff9:
- IF '$P9' = '' ResetCirc
- ASSIGN PHONE '$P9'
- GOTO BackFromStuff
- ResetCirc:
- ASSIGN CIRCNUM 1
- GOTO BackFromReset
-