home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / q4rly20.zip / Q4RLY.SCR < prev    next >
Text File  |  1989-04-04  |  11KB  |  308 lines

  1. ;--------------------------------------------------------------------------;
  2. ;                              Q4RLY.SCR                                   ;
  3. ;                             version 2.00
  4. ;     A very easy to use Qmodem script for PCRelay mail transfers          ;
  5. ;                                                                          ;
  6. ;            (c) Copyright 1988, 1989 by Robert B. Browne                  ;    ;
  7. ;                                                                          ;
  8. ;     This script is provided for those PCRelay sysops who wish to         ;
  9. ;     run their mail transfers in unattended mode, but do not have         ;
  10. ;     the time or inclination to write their own script.  Q4Relay is       ;
  11. ;     a general purpose Relay script with enough error checking to         ;
  12. ;     prevent it from hanging, and features an easy 'fill in the blank'    ;
  13. ;     data area for ease of set-up.  Just fill in the proper values below  ;
  14. ;     after reading the Q4RLY.DOC file) and you'll be on your way.         ;
  15. ;                                                                          ;
  16. ;     Good luck                                                            ;
  17. ;                         ---[ Bob ]---                                    ;
  18. ;                                                                          ;
  19. ;--------------------------------------------------------------------------;
  20.  
  21.  
  22. STRING NAME DOOR NODEID PATH INIT       ; set up special variables
  23. STRING TYPE PHONE PWRD HUB DIALS WAIT
  24. STRING PROT CALLERS
  25.  
  26. ASSIGN PROT "R"                         ; set the protocol.  If the protocol
  27.                                         ; is external, it MUST be defined in
  28.                                         ; Qmodem install routine <ALT>N
  29.  
  30. ASSIGN PWRD "xxxxxxxx"                  ; you must set this variable if
  31.                                         ; using TYPE MAN
  32.  
  33. ASSIGN NAME "BOB BROWNE"                ; your name goes here
  34.  
  35. ASSIGN DOOR "25"                        ; the door number for you hub here
  36.  
  37. ASSIGN NODEID "SOLUTION"                ; your node id goes here
  38.  
  39. ASSIGN HUB "HUBNY1"                     ; ID code for your HUB
  40.  
  41. ASSIGN PATH "E:\Q4\RELAY"               ; path to IN.RLY and outgoing packet
  42.                                         ; DO NOT use a trailing backslash
  43.  
  44. ASSIGN INIT "H"                         ; modem init string null if none used
  45.                                         ; * NOTE:  If your modem defaults
  46.                                         ; to MNP ON, and your HUB does not
  47.                                         ; have an MNP modem, then you MUST
  48.                                         ; put the MNP OFF command here.
  49.                                         ; otherwise, the script will never
  50.                                         ; see the CONNECT message from
  51.                                         ; PCBOARD (which is used to
  52.                                         ; determine if we have a baud rate
  53.                                         ; match) and the script will keep
  54.                                         ; recycling.
  55.  
  56. ASSIGN TYPE "MAN"                       ; type is MAN or DIR
  57.                                         ; - if type MAN then put the
  58.                                         ; actual telephone number of the
  59.                                         ; hub in PHONE, if type DIR then put
  60.                                         ; the number of the dialing directory
  61.                                         ; record in PHONE
  62.  
  63. ASSIGN PHONE "x-xxx-xxx-xxxx"           ; your hub's dialing directory number
  64.                                         ; or telephone number depending on TYPE.
  65.                                         ; MAKE SURE YOUR PASSWORD IS IN THE
  66.                                         ; DIALING DIRECTORY IF YOU USE TYPE
  67.                                         ; 'DIR'
  68.  
  69. ASSIGN DIALS 60                         ; Maximum number of dial attempts if
  70.                                         ; using TYPE MAN.
  71.  
  72. ASSIGN WAIT 5000                        ; Number of milliseconds to wait
  73.                                         ; between re-dial attempts when
  74.                                         ; using type MAN.  1000=1 second.
  75.                                         ; recommended value is 5000 for a
  76.                                         ; 5 second re-dial pause.  This
  77.                                         ; will prevent your HUB from getting
  78.                                         ; stuck with continuous modem reset
  79.                                         ; errors
  80.  
  81. ASSIGN 9 0                              ; these are loop counter variables
  82.                                         ; DO NOT change these values
  83.  
  84. ASSIGN CALLERS 0
  85. ;----------------------------------------------------------------------------
  86. ;
  87. ;         MAKE SURE YOU FILL IN ALL YOUR DATA ABOVE !!!!!
  88. ;
  89. ;----------------------------------------------------------------------------
  90. INITIALIZE:
  91.         IF '$0' = '' INITIALIZE1
  92.         SETCOMM $0
  93. INITIALIZE1:
  94.  
  95.         PAUSE 1000
  96.         TIMEOUT 5 INITIALIZE2
  97.  
  98. INITIALIZE2:
  99.  
  100.         SEND "AT$INIT^M"
  101.         WAITFOR "OK"
  102.  
  103. START:
  104.         IF '$TYPE' = 'MAN' MANUAL
  105.         IF '$TYPE' = 'DIR' DIRECTORY
  106.         DISPLAYLN "Uknown dial TYPE specified"
  107.         STAMP Unknown dial TYPE specified......Aborting at $TIME on $DATE
  108.         GOTO NORMALOUT
  109.  
  110. MANUAL:
  111.         WHEN "NO CARRIER" MANUAL2
  112.         TIMEOUT 60 MANUAL2              ; 60 = number of seconds to wait for
  113.         WHEN "BUSY" MANUAL2             ; carrier.  It's better if you leave
  114.         WHEN "NO DIAL TONE" MANUAL2     ; this set this way, and set your modem
  115.         WHEN "VOICE" MANUAL2            ; to timoute 30 or 45 - this way the
  116.                                         ; loop is driven by the WHEN statement
  117.                                         ; instead of the TIMEOUT.
  118.         ASSIGN 2 $DIALS
  119.         INCR 2
  120.         WHEN "RING" INCOMING
  121.  
  122. MANUAL1:
  123.         GOSUB CONFIG_WINDOW
  124.         COLOR 11
  125.         BOX 31,1,80,7
  126.         ATWRITE 33 1 11 "[ Manual Dialing - $DIALS attempts ]"
  127.         WINDOW 33,2,79,6
  128.         COLOR 3
  129. MANUAL2:
  130.         INCR 9
  131.         IF '$9' = '1' NO_WAIT
  132.         IF '$9' = '$2' NO_ANSWER
  133.         DISPLAYLN "  "
  134.         DISPLAY "Pausing $WAIT milliseconds for Re-Dial"
  135.         PAUSE $WAIT
  136. NO_WAIT:
  137.         CLRSCR
  138.         IF '$9' = '1' NO_CR
  139.         DISPLAYLN "Dial attempt # $9 of $DIALS"
  140.         GOTO CR
  141.  NO_CR:
  142.         DISPLAY "Dial attempt # $9 of $DIALS"
  143.  CR:
  144.         SEND "ATDT$PHONE^M"
  145.         WAITFOR "CONNECT"
  146.         GOTO PICKUP
  147.  
  148. DIRECTORY:
  149.         GOSUB CONFIG_WINDOW
  150.         PAUSE 2000
  151.         DIAL "$PHONE"
  152.         GOTO PICKUP
  153.  
  154. PICKUP:
  155.         WINDOW 1,1,80,24
  156.         CLRSCR
  157.         COLOR 13
  158.         WHEN
  159.  
  160. PICKUP2:
  161.         WHEN "NO CARRIER" BADCONNECT
  162.         TIMEOUT 5 BADCONNECT
  163.         WAITFOR "CONNECT"               ; this is waiting for the CONNECT
  164.                                        ; message from PCBoard. If found it
  165.                                        ; ensures that we are connected at the
  166.                                        ; proper baud rate and aren't getting
  167.                                        ; too much line noise yet.
  168.  
  169. CONTINUE:
  170.         WHEN
  171.         WHEN 'NO CARRIER' CARRIER_LOSS
  172.         TIMEOUT 30 ABORT
  173.         When "name?" "$NAME^M"
  174.         IF '$TYPE' = 'MAN' MAN_PWRD
  175.         When 'echo)?' "$PASSWORD^M"
  176.         GOTO CONT2
  177. MAN_PWRD:
  178.         When "echo)?" "$PWRD^M"
  179. CONT2:
  180.         When "(Enter) to continue?" "^M"
  181.         When "no change" "^M"
  182.         When "=yes?" "N^M"
  183.         When "=no?" "N Q NS $NODEID^M"
  184.         WHEN "(Y), (N), (NS)?" "N^M"
  185.         When "More?" "N^M"
  186.         WHEN "non-stop" "N^M"
  187.         WAITFOR "Command?"
  188.         When
  189. ImOn:
  190.         Beep 1200
  191.         Beep 1400
  192.  
  193. ToNormal:
  194.         TIMEOUT 240 ABORT
  195.         Send "OPEN $DOOR^M"
  196.         PAUSE 1000
  197.         DISPLAYLN " "
  198.         Display "Connected to: "
  199.         IF '$TYPE' = 'MAN' DISP2
  200.         Displayln "$BOARD ($HUB) for a RelayNet(TM) Transmission."
  201.         GOTO DISP_CONT
  202.         DISP2:
  203.         Displayln "$HUB for a RelayNet(TM) Transmission."
  204.         DISPLAYLN " "
  205.         GETSCR
  206.  
  207. DISP_CONT:
  208.         WAITFOR '*'
  209.         UPLOAD $PROT $PATH\$NODEID.RLY
  210.         PAUSE 500            ; 1/2 second pause to let receive buffer clear
  211.         WAITFOR '*'
  212.         DOWNLOAD $PROT $PATH\IN.RLY
  213.         WHEN 'NO CARRIER' NORMALOUT
  214.         PUTSCR
  215.         Waitfor 'Command?'
  216.         SEND "G^M"
  217.         Waitfor 'NO CARRIER'
  218.         GOTO NORMALOUT
  219.  
  220.  
  221. BADCONNECT:
  222.         CLRSCR
  223.         TIMEOUT 5 BADCONNECT2
  224.         DISPLAYLN "Bad connection with $HUB - RECOVERING..."
  225.         STAMP $TIME - $DATE - Bad connection with $HUB - RECOVERING...
  226.  
  227. BADCONNECT2:
  228.         HANGUP
  229.         IF '$TYPE' = 'MAN' MANUAL1
  230.         IF '$TYPE' = 'DIR' DIRECTORY
  231.  
  232.  
  233. CARRIER_LOSS:
  234.         HANGUP
  235.         STAMP Aborting Relay transfer due to loss of carrier with $HUB at $TIME on $DATE
  236.         DISPLAYLN "Aborting Relay transfer due to loss of carrier with $HUB at $TIME on $DATE"
  237.         GOTO NORMALOUT
  238.  
  239.  
  240. ABORT:
  241.         HANGUP
  242.         STAMP ABORTING RELAY TRANSFER AT $TIME ON $DATE DUE TO TIMEOUT ON $HUB
  243.         DISPLAYLN "Aborting Relay transfer at $Time on $Date due to timeout on $HUB"
  244.         GOTO NORMALOUT
  245.  
  246. NO_ANSWER:
  247.         STAMP $HUB failed to answer after $DIALS attempts at $TIME on $DATE
  248.         DISPLAYLN "$HUB failed to answer after $DIALS attempts at $TIME on $DATE"
  249.  
  250. NORMALOUT:
  251.         EXIST SP.ERR SEND_LOG
  252.         GOTO SKIP_S
  253.         SEND_LOG:
  254.         STAMP DSZ Reports error on RelayNet(tm) upload at $TIME on $DATE
  255.         SKIP_S:
  256.         EXIST RP.ERR RECV_LOG
  257.         GOTO SKIP_R
  258.         RECV_LOG:
  259.         STAMP DSZ Reports error on RelayNet(tm) download at $TIME on $DATE
  260.         SKIP_R:
  261.  
  262.         TIMEOUT 10 OUTAGAIN
  263.  
  264. OUTAGAIN:
  265.         PAUSE 500
  266.         SEND "ATM0H1^M"
  267.         WAITFOR "OK"
  268.         TURNOFF CAPTURE
  269.         IF '$CALLERS' = '0' FINALOUT
  270.         STAMP Mail script completed on $DATE at $TIME was interrupted by $CALLERS callers
  271. FINALOUT:
  272.         SYSTEM X
  273.  
  274. INCOMING:
  275.         INCR CALLERS
  276.         SEND "ATA^M"
  277.         WAITFOR "CONNECT"
  278.         SEND "The board is currently attempting to dial out^M^J"
  279.         SEND "for a RelayNet(tm) mail transfer.  Please call^M^J"
  280.         SEND "back in 30 minutes.  Your patience is appreciated.^M^J"
  281.         SEND "^M^J"
  282.         PAUSE 5000
  283.         HANGUP
  284.         GOTO MANUAL2
  285.  
  286.  
  287.  
  288. CONFIG_WINDOW:
  289.         WINDOW 1,1,80,24
  290.         CLRSCR
  291.         COLOR 11
  292.         BOX 1,1,30,15
  293.         ATWRITE 3 1 11 "[ Configuration ]"
  294.         COLOR 3
  295.         WINDOW 3,3,29,14
  296.         DISPLAYLN "Name:   $NAME"
  297.         DISPLAYLN "Door:   $DOOR"
  298.         DISPLAYLN "NODEID: $NODEID"
  299.         DISPLAYLN "Path:   $PATH"
  300.         DISPLAYLN "Init:   $INIT"
  301.         DISPLAYLN "Type:   $TYPE"
  302.         DISPLAYLN "Phone:  $PHONE"
  303.         DISPLAYLN "PWRD:   $PWRD"
  304.         DISPLAYLN "HUB:    $HUB"
  305.         DISPLAYLN "Dials:  $DIALS"
  306.         DISPLAY "WAIT:   $WAIT"
  307. RETURN
  308.