home *** CD-ROM | disk | FTP | other *** search
- ;|================================================================|
- ;| |
- ;| DCWAS24.ASP for NET/Mail transfers via |
- ;| November 1, 1989 Telenet's PCPursuit Service |
- ;| |
- ;| Author : Copyright (c)1989 by Edward Thigpen |
- ;| |
- ;| Licensed for use subject to the terms outlined in the |
- ;| accompanying documentation file. |
- ;| |
- ;|================================================================|
-
- LOG OPEN "NETMAIL.LOG" ; [d:][\path\]NETMAIL.LOG
- MESSAGE "****** START NET/Mail TRANSFER ******"
- DATE S6
- MESSAGE S6 ;\
- TIME S6 0 ; > initialize log file
- MESSAGE S6 ;/
- MESSAGE " "
- LOG SUSPEND
-
- ASSIGN S0 "###-####" ; local telenet number
- ASSIGN S1 "XXXXXxxx" ; pc pursuit city code
- ASSIGN S2 "###-###-####" ; bbs a/c and number
- ASSIGN S3 "First Lastname" ; your name on the bbs
- ASSIGN S4 "password" ; your password on bbs
- ASSIGN S5 "OPEN #" ; netmail door to open
- ASSIGN S6 "10" ; used within script
- ASSIGN S7 " " ; used within script
- ASSIGN S8 "Telenet ID" ; your telenet id code
- ASSIGN S9 "Telenet Password" ; your telenet password
-
- CUROFF
- ATOI S6 N0 ;\
- ATOI S6 N1 ; \
- ATOI S6 N2 ; \
- DIV N0 2 N3 ; > initialize retry counters
- DIV N0 N0 N4 ; /
- DIV N0 N0 N5 ; /
- MUL N0 48 N6 ;/
-
- LOG RESUME ;\
- MESSAGE S1 ; \
- MESSAGE "========" ; > update log file
- ASSIGN S6 "START" ; /
- GOSUB LFILE ;/
-
- ;GOTO DIRECT
-
- PCP:
- GOSUB MORESET ; reset modem
- TRANSMIT "ATDT"
- TRANSMIT S0 ; dialing local telenet access
- TRANSMIT "^m"
- WAITFOR "CONNEC" 45
- IF WAITFOR
- GOTO TEL
- ENDIF
- ASSIGN S6 "@@ Telenet Inbound Failure @@"
- GOSUB LFILE ; update log file
- GOTO FAIL ; handle connect failure
-
- TEL:
- PAUSE 1 ;\
- TRANSMIT "@~D^m" ; > wakeup telenet @ 2400 baud
- WAITFOR "=" 15 ;/
- IF WAITFOR
- GOTO COMP
- ENDIF
- ASSIGN S6 "@@ Telenet Wakeup Failure @@"
- GOSUB LFILE ; update log file
- GOTO FAIL ; handle wakeup failure
-
- COMP:
- TRANSMIT "D1^m" ; identify terminal type
- WAITFOR "@" 10
- IF WAITFOR
- GOTO PW
- ENDIF
- ASSIGN S6 "@@ Telenet Login Failure @@"
- GOSUB LFILE ; update log file
- GOTO FAIL ; handle telenet login failure
-
- PW:
- ASSIGN S6 " "
- SUBSTR S6 S1 0 5 ; truncate pcpursuit city code
- TRANSMIT "C D/" ; send connect request
- TRANSMIT S6 ; send city code
- TRANSMIT "/24," ; state 2400 baud
- TRANSMIT S8 ; send telenet id code
- TRANSMIT "," ; delimiter
- TRANSMIT S9 ; send telenet password
- TRANSMIT ^m"
-
- ASSIGN S6 " " ;\
- RGET S6 ; \
- RGET S6 ; > wait for distant connect
- RGET S6 80 40 ; /
- FIND S6 "CONNEC" ;/
- IF FOUND
- GOTO BBS
- ENDIF
- ASSIGN S6 "@@ Telenet Distant Node Busy @@"
- GOSUB LFILE ; update log file
- DEC N1 ; update retry counter
- IF NOT ZERO N1
- GOTO PW
- ENDIF
- GOTO OFF
-
- BBS:
- TRANSMIT "ATZ^m" ; wakeup remote city modem
- PAUSE 5
- ASSIGN S6 " "
- SUBSTR S6 S2 4 8 ; get bbs number without a/c
- TRANSMIT "ATDT" ; send dial command
- TRANSMIT S6 ; send bbs number without a/c
- TRANSMIT "^m"
- ASSIGN S6 " "
- WAITFOR "CONNEC" 30
- IF WAITFOR
- GOTO NET
- ENDIF
- ASSIGN S6 "@@ Outbound Node Failure @@"
- GOSUB LFILE ; update log file
- DEC N0 ; update retry counter
- IF NOT ZERO N0
- GOTO BBS
- ENDIF
-
- OFF:
- IF NOT ZERO N5 ; update retry counter
- ASSIGN S6 "0"
- ATOI S6 N5 ; reset retry counter
- TRANSMIT "ATZ^m~~HANGUP^m" ; disconnect from telenet
- HANGUP
- TIME S6 0
- CLEAR ; begin 10 minute wait for retry
- BOX 3 18 9 58 2
- ATSAY 5 33 140 "- OFFLINE -"
- ATSAY 7 23 14 "Retry begins in about 10 minutes"
- ATSAY 11 31 7 "START:"
- ATSAY 11 38 3 S6
- ATSAY 13 29 7 "CURRENT:"
- ATSAY 17 22 6 "Press 'A' to abort 10 minute timer"
- ATSAY 17 28 207 " A "
-
- CLOCK:
- IF NOT ZERO N6 ;\
- TIME S6 0 ; \
- ATSAY 13 38 11 S6 ; \
- DEC N6 ; \
- WAITFOR "a" 1 ; > countdown clock routine
- IF WAITFOR ; /
- GOTO RESTART ; /
- ENDIF ; / (accuracy: +/- 60 sec)
- GOTO CLOCK ;/
- ENDIF
-
- RESTART:
- CLEAR
- ASSIGN S6 "10" ;\
- ATOI S6 N0 ; \
- ATOI S6 N1 ; > reinitialize retry counters
- ATOI S6 N2 ; /
- LOG RESUME ;/
- MESSAGE " "
- MESSAGE S1
- MESSAGE "========"
- ASSIGN S6 "RE-START"
- GOSUB LFILE ; update log file
- GOTO PCP ; try it again
- ENDIF
-
- DIRECT:
- GOTO BAD ; blocks direct dial feature
-
- ASSIGN S6 "0"
- ATOI S6 N4 ; set system retry counter to 0
- GOSUB MORESET ; reset modem
- TRANSMIT "ATDT1"
- TRANSMIT S2 ; dial bbs with area code
- TRANSMIT "^m"
- WAITFOR "CONNEC" 30
- IF WAITFOR
- GOTO BBS
- ENDIF
- ASSIGN S6 "@@ Direct Dial Failure @@"
- GOSUB LFILE ; update log file
- DEC N3
- IF NOT ZERO N3 ; update retry counter
- HANGUP
- PAUSE 30
- GOTO DIRECT
- ENDIF
- GOTO BAD ; give it up for tonight
-
- NET:
- WHEN "ontinue" "^m"
- WAITFOR "=no?" 15 ; see documentation about ----------> ;*
- IF NOT WAITFOR ; these lines ----------> ;*
- ASSIGN S6 "@@ HUBFAIL: Graphics Prompt @@"; ---------> ;*
- GOSUB LFILE ; update log file --------> ;*
- GOTO PROB ; declare fatal error, hangup ------> ;*
- ENDIF ; ------> ;*
- ASSIGN S6 "TIME IN:"
- GOSUB LFILE ; update log file
- TRANSMIT "n q^m" ; ------> ;*
- WAITFOR "name?" 30
- IF NOT WAITFOR
- TRANSMIT "^m" ;\
- WAITFOR "name?" 15 ; > recover from missing name prompt
- IF NOT WAITFOR
- ASSIGN S6 "@@ HUBFAIL: Name Prompt @@"
- GOSUB LFILE ; update log file
- GOTO PROB ; declare fatal error, hangup
- ENDIF
- ENDIF
- TRANSMIT S3
- TRANSMIT "^m"
- WAITFOR "echo)?" 15
- IF NOT WAITFOR
- ASSIGN S6 "@@ HUBFAIL: Password Prompt @@"
- GOSUB LFILE ; update log file
- GOTO PROB ; declare fatal error, hangup
- ENDIF
- TRANSMIT S4
- TRANSMIT "^m"
- WAITFOR "=yes?" 30
- IF NOT WAITFOR
- ASSIGN S6 "@@ HUBFAIL: Mail Check Prompt @@"
- GOSUB LFILE ; update log file
- GOTO PROB ; declare fatal error, hangup
- ENDIF
- CWHEN
- WHEN "More?" "n^m" ; watch file more prompts
- TRANSMIT "n^m"
- WAITFOR "and?" 20
- IF NOT WAITFOR
- TRANSMIT "^m" ;\
- WAITFOR "and?" 20 ; > recover from missing prompt
- IF NOT WAITFOR
- ASSIGN S6 "@@ HUBFAIL: Main Command Prompt @@"
- GOSUB LFILE ; update log file
- GOTO PROB ; declare fatal error, hangup
- ENDIF
- ENDIF
-
- NETMAIL:
-
- TRANSMIT S5 ; open netmail door
- TRANSMIT "^m"
- WAITFOR "ing Pro" 120
- IF NOT WAITFOR
- ASSIGN S6 "@@ HUBFAIL: Door Locked Message @@"
- GOSUB LFILE ; update log file
- GOTO PROB ; declare fatal error, hangup
- ENDIF
- WAITFOR "0000" 60 ; dsz initialization string
- IF NOT WAITFOR
- ASSIGN S6 "@@ HUBFAIL: DSZ Upload Prompt @@"
- GOSUB LFILE ; update log file
- GOTO PROB ; declare fatal error, hangup
- ENDIF
- ASSIGN S6 "====== NET/Mail UPLOAD STARTED ======"
- GOSUB LFILE ; update log file
- DOS OUT ; shell to dos, execute out.bat
- WAITFOR "Data" 30 ; watch hub messages
- IF NOT WAITFOR
- ASSIGN S6 "@@ HUBFAIL: Upload Questionable @@"
- GOSUB LFILE ; update log file
- GOTO PROB ; declare fatal error, hangup
- ENDIF
- WAITFOR "Confer" 90 ; watch hub messages
- IF NOT WAITFOR
- ASSIGN S6 "@@ HUBFAIL: Importing Conference @@"
- GOSUB LFILE ; update log file
- GOTO PROB ; declare fatal error, hangup
- ENDIF
- WAITFOR "0000" 600 ; dsz initialization string
- IF NOT WAITFOR
- ASSIGN S6 "@@ HUBFAIL: DSZ Download Prompt @@"
- GOSUB LFILE ; update log file
- GOTO PROB ; declare fatal error, hangup
- ENDIF
- ASSIGN S6 "===== NET/Mail DOWNLOAD STARTED ====="
- GOSUB LFILE ; update log file
- DOS IN ; shell to dos, execute in.bat
- WAITFOR "and?" 60 ; wait for command prompt
- TRANSMIT "g^m" ; exit hub bbs
- ASSIGN S6 "TIME OUT:"
- GOSUB LFILE ; update log file
-
- DOS MCALL ; shell to dos, execute mcall.bat
-
- GOTO DONE ; finish up routine
-
- FAIL:
- HANGUP
- DEC N2 ; update retry counter
- IF NOT ZERO N2
- GOSUB MORESET ; reset modem
- GOTO PCP ; try again through pcpursuit
- ENDIF
- GOTO DIRECT ; forget pcpursuit, try direct dial
-
- PROB:
- HANGUP
- PAUSE 5
- IF NOT ZERO N4 ; update retry counter
- LOG RESUME
- MESSAGE " "
- MESSAGE S1
- MESSAGE "========"
- ASSIGN S6 "RE-START"
- GOSUB LFILE ; update log file
- DEC N4
- GOSUB MORESET ; reset modem
- PAUSE 10
- GOTO PCP ; try again
- ENDIF
-
- BAD:
- LOG RESUME
- MESSAGE " ---- A L E R T ----"
- MESSAGE " "
- MESSAGE " ============================="
- MESSAGE " NET/Mail TRANSFER FAILURE"
- MESSAGE " ============================="
- MESSAGE " "
- MESSAGE " ---- A L E R T ----"
- ASSIGN S6 " "
- GOSUB LFILE ; update log file
-
- DONE:
- PAUSE 5
- TIME S6 0
- LOG RESUME
- MESSAGE " "
- MESSAGE "PCP DISCONNECT"
- MESSAGE "=============="
- MESSAGE S6
- MESSAGE "=========="
- MESSAGE " "
- LOG CLOSE ; final update to log file
-
- TRANSMIT "HANGUP^m" ; disconnect from pcpursuit
- PAUSE 5
- HANGUP ; hangup modem
- PAUSE 5
-
- QUIT ; drop to dos, complete netsend.bat
-
- LFILE:
- KFLUSH ;\
- RFLUSH ; > flush i/o buffers
- LOG RESUME
- MESSAGE S6 ;\
- TIME S6 0 ; \
- MESSAGE S6 ; > timestamp/message to log file
- MESSAGE " " ; /
- LOG SUSPEND ;/
- RETURN
-
- MORESET:
- KFLUSH ;\
- RFLUSH ; > flush i/o buffers
- TRANSMIT "ATZ^m" ; reset modem
- PAUSE 5
- RETURN