home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / petnet10.zip / PN_MAIL.SCR < prev    next >
Text File  |  1994-06-14  |  8KB  |  174 lines

  1. ; TEST script for echo mail runs from Critter Connection BBS for Qmodem Pro. 
  2. ; It's only a Basic starting point that needs to be EDITED in parts, and 
  3. ; also some of the Timings might need adjustments.
  4. ; Modified from the script listed in the QmodemPro 1.00 manual.  Feel free
  5. ; to make any modifications you wish.  If you make it better, then share it
  6. ; with everyone else.
  7. ;
  8. ; Used in conjunction with the included PN_MAIL.BAT file, it will try to
  9. ; make an unattended mail run to pick up Tomcat mail and send any new mail
  10. ; waiting to be sent.  Make sure you edit DIALTXT, NAME, in the DEFINITIONS
  11. ; section to meet your requirements. (Leave UDONE and DDONE alone).
  12. ;
  13. ; IMPORTANT: You must have HotKeys turned off and Expert mode turned on in
  14. ; your user profile on the BBS, and also make sure the packet name is defined
  15. ; in the FON book entry for the system you will be calling before using this
  16. ; script.
  17. ;
  18. ; If you'll be using other comm. programs i.e. Robocom, Telix, Boyan etc.
  19. ; please share with us your script(s) so that they'll be available for
  20. ; others.  Thanks!
  21. ;
  22. ;
  23. TurnOn  8_BIT
  24. TurnOff LINEFEED
  25. TurnOff XON/XOFF
  26. TurnOff NOISE
  27. TurnOff MUSIC
  28. TurnOn  SCROLL
  29. TurnOff PRINT
  30. TurnOff ECHO
  31. Capture MAILRUN.CAP
  32. Log     MAILRUN.LOG
  33. ;
  34. ; ------------------------ DEFINITIONS -------------------------
  35. ;
  36. String  NAME UDONE DDONE DOOR MAXTRIES FONTXT TCLOGOFF DIALTXT
  37. Assign  DIALTXT "PN_Mail"               ; unique text string from FON file
  38. Assign  NAME    " ***fill in here*** "  ; Name and Password on BBS
  39. Assign  UDONE   N                       ; Upload done?
  40. Assign  DDONE   N                       ; Download done?
  41. Assign  MAXTRIES 7                      ; Maximum attempts to connect
  42. Assign  TCLOGOFF N                      ; Set Logoff after upload to N in Tomcat
  43. ;
  44. ; --------------------- END DEFINITIONS ------------------------
  45. ;
  46.  
  47. Restart:                                ; Go here if the connection gets
  48.                                         ; broken then stamp log
  49. Stamp NO CARRIER detected, restarting script
  50.  
  51. ; Notes:
  52. ; The DIAL command uses the ability to call a specific number, without
  53. ; knowing the exact position in the .FON file.  The example DIALTXT set up
  54. ; in this script will search the .FON file for the text "MSI HQ".  By using
  55. ; the Text dial option and specifying this, it will dial this number even
  56. ; if the FON book is sorted.  Note the 'T' prefix in the DIAL line below...
  57.  
  58. ;-----
  59. ; Dial section starts here
  60. ;-----
  61. Decr    MAXTRIES                        ; decrement the counter
  62. If      "$MAXTRIES" = "0" TooManyTries  ; if none left goto TooManyTries
  63. If      $ONLINE SkipDial                ; skip the dial if online already
  64. Dial    "T$DIALTXT"                     ; dial selected entry
  65. SkipDial:
  66. TimeOut 1200 OutOfTime                  ; set Waitfor timeout to 1200 seconds
  67. Goto    Top                             ; jump to start of main body
  68. OutOfTime:                              ; come here if something times out
  69. Hangup                                  ; hang up the phone
  70. Delay   10000                           ; wait 10 seconds
  71. Hangup                                  ; hang up again (just in case)
  72. Delay   30000                           ; wait 30 seconds
  73. Goto    Restart                         ; start over again
  74.  
  75. ;-----
  76. ; Main Body starts here
  77. ;-----
  78. Top:                                    ; label for main body of script
  79. When    "NO CARRIER" Restart            ; goto label restart if fails
  80. When    "[S]top?" "S^M"                 ; send S Enter at any pause prompt
  81. When    "[L]ist mail, or [C]on" "C^M"   ; send C Enter at mail notice
  82. Waitfor  "First Name"
  83. Delay    300
  84. Send     "!***** fill in here *****^M"  ; Don't forget to put ! in front.
  85.  
  86. Waitfor  "Are you"                      ; No need to fill this in
  87. Delay    200
  88. Send     "Y^M"
  89.  
  90. Waitfor "TOMCAT MENU"                   ; wait for the Tomcat menu prompt
  91.  
  92. ;-----
  93. CmdLoop:                                ; label for command loop
  94. If      "$DDONE" = "N" DoDownload       ; download not done, do it
  95. If      "$UDONE" = "N" DoUpload         ; upload not done, do it
  96. Goto AllDoneN                           ; only if both of above are done
  97.  
  98. ;-----
  99. DoDownload:                             ; label for download section
  100. When    "nothing" DownloadOK            ; go to label if no msgs to download
  101. Send    "^M"                            ; send ENTER for check (optional)
  102. Waitfor "TOMCAT MENU"                   ; wait for menu again  (optional)
  103. Delay   2000                            ; wait 2 seconds
  104. Send    "D^M"                           ; send D ENTER for download
  105. Waitfor "receive this packet"           ; wait until packet is ready
  106. Delay   100                             ; delay .1 seconds
  107. Send    "Y^M"                           ; answer Y ENTER
  108. Waitfor "$PACKET.QWK"                   ; wait until it's ready to send
  109. Stamp   Beginning download of $QWKPATH$PACKET.QWK ; stamp log
  110. Download Z $QWKPATH$PACKET.QWK          ; start the download
  111. If      $SUCCESS DownloadOK             ; if ok, branch to label
  112. Stamp   Download FAILED                 ; make note in log that it failed
  113. Goto    DoDownload                      ; and do it again
  114.  
  115. ;-----
  116. DownloadOK:                             ; label for OK downloads
  117. Stamp   Download successful             ; make note in log that it was a success
  118. Assign  DDONE Y                         ; change download flag to Y
  119. Goto    CmdLoop                         ; branch back to Command Loop
  120.  
  121. ;-----
  122. DoUpload:                               ; label for upload section
  123. Delay   2000                            ; wait for 2 seconds
  124. Send    "^M"                            ; send ENTER key  (optional)
  125. Waitfor "TOMCAT MENU"                   ; wait for Tomcat (optional)
  126. Delay   200                             ; wait .2 seconds
  127. Exist   $REPPATH$PACKET.REP SendMsgs    ; if there are messages to send then
  128.                                         ; goto SendMsgs
  129. Assign  UDONE Y                         ; if no messages to send, flag that
  130.                                         ; uploading is done
  131. Goto    CmdLoop                         ; and branch back to Command Loop
  132.  
  133. ;-----
  134. SendMsgs:                               ; label for SendMsgs section
  135. Send    "U^M"                           ; send U ENTER
  136. Waitfor "$PACKET.REP"                   ; wait until Tomcat is ready
  137. Pause   1000                            ; wait 1 second
  138. Upload  Z $REPPATH$PACKET.REP           ; start the upload
  139. If      $FAIL DoUpload                  ; if not OK then do it again
  140. ;DeleteF $REPPATH$PACKET.REP            ; If not renamed in the batch file, delete the .REP
  141. If      "$TCLOGOFF" = "Y" AllDoneY      ; if Tomcat set to logoff after upload
  142.                                         ; branch to AllDoneY
  143. Assign  UDONE Y                         ; set upload flag to Y
  144.  
  145. ;-----
  146. AllDoneN:                               ; label when up and downloads are done
  147. When                                    ; cancels all previous When tracking
  148. Send    "^M"                            ; send ENTER      (optional)
  149. Waitfor "TOMCAT MENU"                   ; wait for menu
  150. Send    "G^M"                           ; send G ENTER to logoff
  151. Delay   10000                           ; wait 10 seconds (adjust)
  152. Goto    EndGame                         ; branch to EndGame label
  153.  
  154. ;-----
  155. AllDoneY:
  156. When                                    ; stop tracking all previous WHENs
  157. When    "Auto Logoff" "H^M"             ; send H + ENTER to logoff
  158. Assign  UDONE Y                         ; set the upload done flag
  159.  
  160. ;-----
  161. EndGame:                                ; label for end of script
  162. Hangup                                  ; hangup the modem
  163. Delay   2000                            ; wait 2 seconds
  164. Send    "ATM0H1^M"                      ; take modem offhook
  165. TurnOff Log                             ; close the log file
  166. System  Y                               ; exit back to DOS
  167. Exit                                    ; end of script (if successful)
  168.  
  169. ;-----
  170. TooManyTries:
  171. Stamp   "Mail attempt failed..."        ; place notice in log file
  172. TurnOff Log                             ; close the log file
  173. Exit                                    ; end of script (if failure)
  174.