home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 147.img / NETMAL46.ZIP / SCRIPTS.ZIP / CALLNET2.ZIP / DCWAS24.ASP < prev    next >
Text File  |  1989-11-01  |  14KB  |  371 lines

  1. ;|================================================================|
  2. ;|                                                                |
  3. ;|    DCWAS24.ASP                for NET/Mail transfers via       |
  4. ;|    November 1, 1989             Telenet's PCPursuit Service    |
  5. ;|                                                                |
  6. ;|         Author : Copyright (c)1989 by Edward Thigpen           |
  7. ;|                                                                |
  8. ;|    Licensed for use subject to the terms outlined in the       |
  9. ;|    accompanying documentation file.                            |
  10. ;|                                                                |
  11. ;|================================================================|
  12.  
  13.     LOG OPEN "NETMAIL.LOG"              ; [d:][\path\]NETMAIL.LOG
  14.     MESSAGE "****** START NET/Mail TRANSFER ******"
  15.     DATE S6
  16.     MESSAGE S6                          ;\
  17.     TIME S6 0                           ; > initialize log file
  18.     MESSAGE S6                          ;/
  19.     MESSAGE " "
  20.     LOG SUSPEND
  21.  
  22.     ASSIGN S0 "###-####"                ; local telenet number
  23.     ASSIGN S1 "XXXXXxxx"                ; pc pursuit city code
  24.     ASSIGN S2 "###-###-####"            ; bbs a/c and number
  25.     ASSIGN S3 "First Lastname"          ; your name on the bbs
  26.     ASSIGN S4 "password"                ; your password on bbs
  27.     ASSIGN S5 "OPEN #"                  ; netmail door to open
  28.     ASSIGN S6 "10"                      ; used within script
  29.     ASSIGN S7 " "                       ; used within script
  30.     ASSIGN S8 "Telenet ID"              ; your telenet id code
  31.     ASSIGN S9 "Telenet Password"        ; your telenet password
  32.  
  33.     CUROFF
  34.     ATOI S6 N0                          ;\
  35.     ATOI S6 N1                          ; \
  36.     ATOI S6 N2                          ;  \
  37.     DIV N0 2 N3                         ;   > initialize retry counters
  38.     DIV N0 N0 N4                        ;  /
  39.     DIV N0 N0 N5                        ; /
  40.     MUL N0 48 N6                        ;/
  41.  
  42.     LOG RESUME                          ;\
  43.         MESSAGE S1                      ; \
  44.         MESSAGE "========"              ;  > update log file
  45.         ASSIGN S6 "START"               ; /
  46.         GOSUB LFILE                     ;/
  47.  
  48. ;GOTO DIRECT
  49.  
  50. PCP:
  51.     GOSUB MORESET                       ; reset modem
  52.     TRANSMIT "ATDT"
  53.     TRANSMIT S0                         ; dialing local telenet access
  54.     TRANSMIT "^m"
  55.     WAITFOR "CONNEC" 45
  56.     IF WAITFOR
  57.         GOTO TEL
  58.     ENDIF
  59.     ASSIGN S6 "@@ Telenet Inbound Failure @@"
  60.     GOSUB LFILE                         ; update log file
  61.     GOTO FAIL                           ; handle connect failure
  62.  
  63. TEL:
  64.     PAUSE 1                             ;\
  65.     TRANSMIT "@~D^m"                    ; > wakeup telenet @ 2400 baud
  66.     WAITFOR "=" 15                      ;/
  67.     IF WAITFOR
  68.         GOTO COMP
  69.     ENDIF
  70.     ASSIGN S6 "@@ Telenet Wakeup Failure @@"
  71.     GOSUB LFILE                         ; update log file
  72.     GOTO FAIL                           ; handle wakeup failure
  73.  
  74. COMP:
  75.     TRANSMIT "D1^m"                     ; identify terminal type
  76.     WAITFOR "@" 10
  77.     IF WAITFOR
  78.         GOTO PW
  79.     ENDIF
  80.     ASSIGN S6 "@@ Telenet Login Failure @@"
  81.     GOSUB LFILE                         ; update log file
  82.     GOTO FAIL                           ; handle telenet login failure
  83.  
  84. PW:
  85.     ASSIGN S6 " "
  86.     SUBSTR S6 S1 0 5                    ; truncate pcpursuit city code
  87.     TRANSMIT "C D/"                     ; send connect request
  88.     TRANSMIT S6                         ; send city code
  89.     TRANSMIT "/24,"                     ; state 2400 baud
  90.     TRANSMIT S8                         ; send telenet id code
  91.     TRANSMIT ","                        ; delimiter
  92.     TRANSMIT S9                         ; send telenet password
  93.     TRANSMIT ^m"
  94.  
  95.     ASSIGN S6 " "                       ;\
  96.     RGET S6                             ; \
  97.     RGET S6                             ;  > wait for distant connect
  98.     RGET S6 80 40                       ; /
  99.     FIND S6 "CONNEC"                    ;/
  100.     IF FOUND
  101.         GOTO BBS
  102.     ENDIF
  103.     ASSIGN S6 "@@ Telenet Distant Node Busy @@"
  104.     GOSUB LFILE                         ; update log file
  105.     DEC N1                              ; update retry counter
  106.     IF NOT ZERO N1
  107.         GOTO PW
  108.     ENDIF
  109.     GOTO OFF
  110.  
  111. BBS:
  112.     TRANSMIT "ATZ^m"                    ; wakeup remote city modem
  113.     PAUSE 5
  114.     ASSIGN S6 " "
  115.     SUBSTR S6 S2 4 8                    ; get bbs number without a/c
  116.     TRANSMIT "ATDT"                     ; send dial command
  117.     TRANSMIT S6                         ; send bbs number without a/c
  118.     TRANSMIT "^m"
  119.     ASSIGN S6 " "
  120.     WAITFOR "CONNEC" 30
  121.     IF WAITFOR
  122.         GOTO NET
  123.     ENDIF
  124.     ASSIGN S6 "@@ Outbound Node Failure @@"
  125.     GOSUB LFILE                         ; update log file
  126.     DEC N0                              ; update retry counter
  127.     IF NOT ZERO N0
  128.         GOTO BBS
  129.     ENDIF
  130.  
  131. OFF:
  132.     IF NOT ZERO N5                      ; update retry counter
  133.         ASSIGN S6 "0"
  134.         ATOI S6 N5                      ; reset retry counter
  135.         TRANSMIT "ATZ^m~~HANGUP^m"      ; disconnect from telenet
  136.         HANGUP
  137.         TIME S6 0
  138.         CLEAR                           ; begin 10 minute wait for retry
  139.         BOX 3 18 9 58 2
  140.         ATSAY 5 33 140 "- OFFLINE -"
  141.         ATSAY 7 23 14 "Retry begins in about 10 minutes"
  142.         ATSAY 11 31 7 "START:"
  143.         ATSAY 11 38 3 S6
  144.         ATSAY 13 29 7 "CURRENT:"
  145.         ATSAY 17 22 6 "Press 'A' to abort 10 minute timer"
  146.         ATSAY 17 28 207 " A "
  147.  
  148. CLOCK:
  149.         IF NOT ZERO N6                  ;\
  150.             TIME S6 0                   ; \
  151.             ATSAY 13 38 11 S6           ;  \
  152.             DEC N6                      ;   \
  153.             WAITFOR "a" 1               ;    > countdown clock routine
  154.             IF WAITFOR                  ;   /
  155.                 GOTO RESTART            ;  /
  156.             ENDIF                       ; /    (accuracy: +/- 60 sec)
  157.             GOTO CLOCK                  ;/
  158.         ENDIF
  159.  
  160. RESTART:
  161.         CLEAR
  162.         ASSIGN S6 "10"                  ;\
  163.         ATOI S6 N0                      ; \
  164.         ATOI S6 N1                      ;  > reinitialize retry counters
  165.         ATOI S6 N2                      ; /
  166.         LOG RESUME                      ;/
  167.             MESSAGE " "
  168.             MESSAGE S1
  169.             MESSAGE "========"
  170.             ASSIGN S6 "RE-START"
  171.             GOSUB LFILE                 ; update log file
  172.         GOTO PCP                        ; try it again
  173.     ENDIF
  174.  
  175. DIRECT:
  176.     GOTO BAD                            ; blocks direct dial feature
  177.  
  178.     ASSIGN S6 "0"
  179.     ATOI S6 N4                          ; set system retry counter to 0
  180.     GOSUB MORESET                       ; reset modem
  181.     TRANSMIT "ATDT1"
  182.     TRANSMIT S2                         ; dial bbs with area code
  183.     TRANSMIT "^m"
  184.     WAITFOR "CONNEC" 30
  185.     IF WAITFOR
  186.         GOTO BBS
  187.     ENDIF
  188.     ASSIGN S6 "@@ Direct Dial Failure @@"
  189.     GOSUB LFILE                         ; update log file
  190.     DEC N3
  191.     IF NOT ZERO N3                      ; update retry counter
  192.         HANGUP
  193.         PAUSE 30
  194.         GOTO DIRECT
  195.     ENDIF
  196.     GOTO BAD                            ; give it up for tonight
  197.  
  198. NET:
  199.     WHEN "ontinue" "^m"
  200.     WAITFOR "=no?" 15                   ; see documentation about ----------> ;*
  201.     IF NOT WAITFOR                      ;             these lines ----------> ;*
  202.         ASSIGN S6 "@@ HUBFAIL: Graphics Prompt @@";                ---------> ;*
  203.         GOSUB LFILE                     ; update log file           --------> ;*
  204.         GOTO PROB                       ; declare fatal error, hangup ------> ;*
  205.     ENDIF                               ;                             ------> ;*
  206.     ASSIGN S6 "TIME IN:"
  207.     GOSUB LFILE                         ; update log file
  208.     TRANSMIT "n q^m"                    ;                             ------> ;*
  209.     WAITFOR "name?" 30
  210.     IF NOT WAITFOR
  211.         TRANSMIT "^m"                   ;\
  212.         WAITFOR "name?" 15              ; > recover from missing name prompt
  213.         IF NOT WAITFOR
  214.             ASSIGN S6 "@@ HUBFAIL: Name Prompt @@"
  215.             GOSUB LFILE                 ; update log file
  216.             GOTO PROB                   ; declare fatal error, hangup
  217.         ENDIF
  218.     ENDIF
  219.     TRANSMIT S3
  220.     TRANSMIT "^m"
  221.     WAITFOR "echo)?" 15
  222.     IF NOT WAITFOR
  223.         ASSIGN S6 "@@ HUBFAIL: Password Prompt @@"
  224.         GOSUB LFILE                     ; update log file
  225.         GOTO PROB                       ; declare fatal error, hangup
  226.     ENDIF
  227.     TRANSMIT S4
  228.     TRANSMIT "^m"
  229.     WAITFOR "=yes?" 30
  230.     IF NOT WAITFOR
  231.         ASSIGN S6 "@@ HUBFAIL: Mail Check Prompt @@"
  232.         GOSUB LFILE                     ; update log file
  233.         GOTO PROB                       ; declare fatal error, hangup
  234.     ENDIF
  235.     CWHEN
  236.     WHEN "More?" "n^m"                  ; watch file more prompts
  237.     TRANSMIT "n^m"
  238.     WAITFOR "and?" 20
  239.     IF NOT WAITFOR
  240.         TRANSMIT "^m"                   ;\
  241.         WAITFOR "and?" 20               ; > recover from missing prompt
  242.         IF NOT WAITFOR
  243.             ASSIGN S6 "@@ HUBFAIL: Main Command Prompt @@"
  244.             GOSUB LFILE                 ; update log file
  245.             GOTO PROB                   ; declare fatal error, hangup
  246.         ENDIF
  247.     ENDIF
  248.  
  249. NETMAIL:
  250.  
  251.     TRANSMIT S5                         ; open netmail door
  252.     TRANSMIT "^m"
  253.     WAITFOR "ing Pro" 120
  254.     IF NOT WAITFOR
  255.         ASSIGN S6 "@@ HUBFAIL: Door Locked Message @@"
  256.         GOSUB LFILE                     ; update log file
  257.         GOTO PROB                       ; declare fatal error, hangup
  258.     ENDIF
  259.     WAITFOR "0000" 60                   ; dsz initialization string
  260.     IF NOT WAITFOR
  261.         ASSIGN S6 "@@ HUBFAIL: DSZ Upload Prompt @@"
  262.         GOSUB LFILE                     ; update log file
  263.         GOTO PROB                       ; declare fatal error, hangup
  264.     ENDIF
  265.     ASSIGN S6 "====== NET/Mail UPLOAD STARTED ======"
  266.     GOSUB LFILE                         ; update log file
  267.     DOS OUT                             ; shell to dos, execute out.bat
  268.     WAITFOR "Data" 30                   ; watch hub messages
  269.     IF NOT WAITFOR
  270.         ASSIGN S6 "@@ HUBFAIL: Upload Questionable @@"
  271.         GOSUB LFILE                     ; update log file
  272.         GOTO PROB                       ; declare fatal error, hangup
  273.     ENDIF
  274.     WAITFOR "Confer" 90                 ; watch hub messages
  275.     IF NOT WAITFOR
  276.         ASSIGN S6 "@@ HUBFAIL: Importing Conference @@"
  277.         GOSUB LFILE                     ; update log file
  278.         GOTO PROB                       ; declare fatal error, hangup
  279.     ENDIF
  280.     WAITFOR "0000" 600                  ; dsz initialization string
  281.     IF NOT WAITFOR
  282.         ASSIGN S6 "@@ HUBFAIL: DSZ Download Prompt @@"
  283.         GOSUB LFILE                     ; update log file
  284.         GOTO PROB                       ; declare fatal error, hangup
  285.     ENDIF
  286.     ASSIGN S6 "===== NET/Mail DOWNLOAD STARTED ====="
  287.     GOSUB LFILE                         ; update log file
  288.     DOS IN                              ; shell to dos, execute in.bat
  289.     WAITFOR "and?" 60                   ; wait for command prompt
  290.     TRANSMIT "g^m"                      ; exit hub bbs
  291.     ASSIGN S6 "TIME OUT:"
  292.     GOSUB LFILE                         ; update log file
  293.  
  294.     DOS MCALL                           ; shell to dos, execute mcall.bat
  295.  
  296.     GOTO DONE                           ; finish up routine
  297.  
  298. FAIL:
  299.     HANGUP
  300.     DEC N2                              ; update retry counter
  301.     IF NOT ZERO N2
  302.         GOSUB MORESET                   ; reset modem
  303.         GOTO PCP                        ; try again through pcpursuit
  304.     ENDIF
  305.     GOTO DIRECT                         ; forget pcpursuit, try direct dial
  306.  
  307. PROB:
  308.     HANGUP
  309.     PAUSE 5
  310.     IF NOT ZERO N4                      ; update retry counter
  311.         LOG RESUME
  312.             MESSAGE " "
  313.             MESSAGE S1
  314.             MESSAGE "========"
  315.             ASSIGN S6 "RE-START"
  316.             GOSUB LFILE                 ; update log file
  317.         DEC N4
  318.         GOSUB MORESET                   ; reset modem
  319.         PAUSE 10
  320.         GOTO PCP                        ; try again
  321.     ENDIF
  322.  
  323. BAD:
  324.     LOG RESUME
  325.     MESSAGE "                   ---- A L E R T ----"
  326.     MESSAGE " "
  327.     MESSAGE "              ============================="
  328.     MESSAGE "                NET/Mail TRANSFER FAILURE"
  329.     MESSAGE "              ============================="
  330.     MESSAGE " "
  331.     MESSAGE "                   ---- A L E R T ----"
  332.     ASSIGN S6 " "
  333.     GOSUB LFILE                         ; update log file
  334.  
  335. DONE:
  336.     PAUSE 5
  337.     TIME S6 0
  338.     LOG RESUME
  339.     MESSAGE " "
  340.     MESSAGE "PCP DISCONNECT"
  341.     MESSAGE "=============="
  342.     MESSAGE S6
  343.     MESSAGE "=========="
  344.     MESSAGE " "
  345.     LOG CLOSE                           ; final update to log file
  346.  
  347.     TRANSMIT "HANGUP^m"                 ; disconnect from pcpursuit
  348.     PAUSE 5
  349.     HANGUP                              ; hangup modem
  350.     PAUSE 5
  351.  
  352.     QUIT                                ; drop to dos, complete netsend.bat
  353.  
  354. LFILE:
  355.     KFLUSH                              ;\
  356.     RFLUSH                              ; > flush i/o buffers
  357.     LOG RESUME
  358.         MESSAGE S6                      ;\
  359.         TIME S6 0                       ; \
  360.         MESSAGE S6                      ;  > timestamp/message to log file
  361.         MESSAGE " "                     ; /
  362.     LOG SUSPEND                         ;/
  363.     RETURN
  364.  
  365.  MORESET:
  366.     KFLUSH                              ;\
  367.     RFLUSH                              ; > flush i/o buffers
  368.     TRANSMIT "ATZ^m"                    ; reset modem
  369.     PAUSE 5
  370.     RETURN
  371.