home *** CD-ROM | disk | FTP | other *** search
/ Boldly Go Collection / version40.iso / TS / 05B / ZMAIL3.ZIP / MAIL.ASP next >
Encoding:
Text File  |  1992-06-27  |  5.8 KB  |  272 lines

  1.  
  2. ; MAIL.ASP - Automating Mail Runs to  PCBoard  or  WILDCAT!  BBSs
  3.  
  4. PROC MAIN
  5.  
  6. ;*********** CUSTOMIZATION SECTION *********************************
  7.   ASSIGN S0 "x-xxx-xxx-xxxx"     ;BBS phone number 1
  8.   ASSIGN S1 "x-xxx-xxx-xxxx"     ;BBS phone number 2
  9.   ASSIGN S2 "xxxxxxxx"           ;your password
  10.   ASSIGN S3 "BBSID"              ;BBS code for REPs & QWKs (NODE-ID)
  11.   ASSIGN S4 "David Lecin"        ;your FIRST and LAST name
  12.   ASSIGN S5 "c:\rep\"            ;your REP directory
  13.   ASSIGN S6 "c:\qwk\"            ;your QWK directory
  14.   ASSIGN S7 ""                   ;Language Number ( ""  for NONE )
  15.   N0=0                           ;Mail Door Number (PCBoard only)
  16.   N1=0                           ; N1=1 - for QMail Door
  17.                                  ; N1=2 - for MarkMail Door
  18.                                  ; N1=2 - for KMail Door
  19.                                  ; N1=3 - for Wildcat/Tomcat
  20.   ASSIGN S8 "N"                  ;TOMCAT command from Message Menu
  21.   N2=0                           ; N2=0 for internal zmodem
  22.                                  ; N2=1 for external protocol
  23.   N3=150                         ;Number of times to dial BBS
  24. ;*********** End Customization Section *****************************
  25.  
  26. ; Set Time to Dial and Set Modem Defaults
  27.    STRING T1
  28.    STRING T2
  29.    INTEGER C1=1
  30.    CLEAR 30
  31.    ATSAY 2 3 14 "Time to Execute Script: (HH:MM) "
  32.    ATGET 2 36 15 5 T1
  33.    IF NULL T1
  34.       C1=0
  35.       ENDIF
  36.    USERMSG "  Acknowledged  "
  37.    STATMSG " Waiting till specified time to execute BBS call ... "
  38.    WHILE NOT ZERO C1
  39.       T2=$TIME1
  40.       FATSAY 4 25 14 "Time Now: "
  41.       FATSAY 4 36 15 T2
  42.       STRCMP T1 T2 5
  43.          IF SUCCESS
  44.             C1 = 0
  45.          ENDIF
  46.    ENDWHILE
  47.    USERMSG "  Executing  "
  48.      SET MODEM MAXDIAL 1
  49.      EMULATE ANSI
  50.      CLEAR 15
  51.      FATSAY 1 22 30 "Press  ESCAPE  twice to cancel ....."
  52.      SET PARITY NONE
  53.      SET DATABITS 8
  54.      SET STOPBITS 1
  55.      SET DUPLEX FULL
  56.      N4=1
  57.    CALL ONE
  58. ENDPROC
  59.  
  60. ;Alternate Dialing the Two Nodes
  61. PROC ONE
  62.      MDIAL S0 S3
  63.        IF NOT CONNECTED
  64.           CALL TWO
  65.        else
  66.           call dzl
  67.        ENDIF
  68.  ENDPROC
  69. PROC TWO
  70.      MDIAL S1 S3
  71.        IF NOT CONNECTED
  72.           N4=N4+1
  73.           IF N4 > N3
  74.              usermsg "  No Response from BBS!  "
  75.              exit
  76.              ENDIF
  77.           CALL ONE
  78.        else
  79.           call dzl
  80.        ENDIF
  81.  ENDPROC
  82.  
  83.  
  84. PROC DZL
  85.  
  86. ;Internal Variable Manipulation
  87.   STRING S10
  88.   STRING S11
  89.   STRING S12
  90.   STRING S13
  91.   STRING S14
  92.   ITOA N0 S14
  93.   STRING S15
  94.   STRING S16
  95.   ASSIGN S15 ".REP"
  96.   ASSIGN S16 ".QWK"
  97.   S9=S3
  98.   STRCAT S9 S15
  99.   ASSIGN S12 ".QWx"
  100.   ASSIGN S13 ".QWy"
  101.   S10=S6
  102.   STRCAT S10 S3
  103.   STRCAT S10 S12
  104.   S11=S6
  105.   STRCAT S11 S3
  106.   STRCAT S11 S13
  107.   STRCAT S5 S3
  108.   STRCAT S5 S15
  109.   STRCAT S6 S3
  110.   STRCAT S6 S16
  111.  
  112. ;Rename Existing QWK
  113.    findfirst S11
  114.      if found
  115.          delete S11
  116.      endif
  117.    findfirst S10
  118.      if found
  119.          rename S10 S11
  120.      endif
  121.    findfirst S6
  122.      if found
  123.          rename S6 S10
  124.      endif
  125.  
  126. ;Flow Control - PCBoard or Wildcat BBS
  127.  IF N1==1
  128.     ELSEIF N1==2
  129.     ELSEIF N1==3
  130.       CALL WCAT
  131.   ELSE
  132.       hangup
  133.       exit
  134.   ENDIF
  135.  
  136. ;Basic PCBoard Prompts
  137.    WHEN 0 "more?" transmit "n^M"
  138.    WHEN 1 "continue" transmit "^M"
  139.    WHEN 2 "(Enter)=yes?" transmit "n^M"
  140.  
  141. ;Language Prompt Response
  142.    IF NULL S7
  143.      ELSE
  144.        waitfor "language" forever
  145.        transmit S7
  146.        transmit "^M"
  147.    ENDIF
  148.  
  149. ;PCBoard Logon, New Files Capture, and Open MailDoor
  150.    waitfor "ics (Enter)=no? " forever
  151.    transmit "Y;Q^M"
  152.    waitfor "our first name? " forever
  153.    transmit S4
  154.    transmit "^M"
  155.    waitfor "s will echo)? (" forever
  156.    transmit S2
  157.    transmit "^M"
  158.    waitfor " Board Command? " forever
  159.    transmit "n;s;A;ns^M" ;*A*
  160.    waitfor " Board Command? " forever
  161.    transmit "open "
  162.    transmit S14
  163.    transmit "^M"
  164.  
  165. ;Upload REP Packet
  166.    findfirst S5
  167.     if found
  168.        waitfor "Command?" forever
  169.        transmit "U^M"
  170.        waitfor S9 forever
  171.        sendfile zmodem S5
  172.             if success
  173.                 delete S5
  174.             endif
  175.      endif
  176.  
  177.    WAITFOR "Command?" forever
  178.  
  179. ;Flow Control - Mail Door
  180.  IF N1==1
  181.       CALL QM
  182.    ELSEIF N1==2
  183.       CALL MM
  184.    ELSE
  185.       TRANSMIT "G^M"
  186.       exit
  187.   ENDIF
  188.  
  189. ENDPROC
  190.  
  191. ;QMail Door
  192.   PROC QM
  193.       transmit "D;Y;G^M"
  194.       when 0 "Prepare to download" call DZL2
  195.       when 2 "Command?" transmit "G^M"
  196.       WHILE CONNECTED
  197.       ENDWHILE
  198.       EXIT
  199.   ENDPROC
  200.   PROC DZL2
  201.      if N2==1
  202.          DOS "xfer "
  203.       endif
  204.   ENDPROC
  205.  
  206. ;MarkMail / KMail Doors (same prompts/replies)
  207.   PROC MM
  208.       transmit "D^M"
  209.       when 2 "Do you want to" call DZL3
  210.       when 0 "Command?" transmit "G^M"
  211.       WHILE CONNECTED
  212.       ENDWHILE
  213.       EXIT
  214.   ENDPROC
  215.   PROC DZL3
  216.       transmit "Y^M"
  217.       waitfor ".QWK" forever
  218.         if N2==1
  219.            DOS "xfer "
  220.          endif
  221.   ENDPROC
  222.  
  223.  
  224. ;WILDCAT! TOMCAT!  Section
  225. PROC WCAT
  226.  
  227. ;Logon and GoTo Tomcat
  228.   WHEN 2 "ontinue" transmit "^M"
  229.   WAITFOR "first name" forever
  230.     TRANSMIT "*"
  231.     TRANSMIT S4
  232.     TRANSMIT " "
  233.     TRANSMIT S2
  234.     TRANSMIT "^M"
  235.   WAITFOR "Main Menu" forever
  236.     TRANSMIT "M^M"
  237.   WAITFOR "Message Menu" forever
  238.     TRANSMIT S8
  239.     TRANSMIT "^M"
  240.  
  241. ;Upload REP
  242.   findfirst S5
  243.     if found
  244.        waitfor "TOMCAT MENU" forever
  245.        transmit "U^M"
  246.        waitfor S9 forever
  247.        sendfile zmodem S5
  248.             if success
  249.                 delete S5
  250.             endif
  251.     endif
  252.  
  253. ;Download QWK
  254.   WAITFOR "TOMCAT MENU" forever
  255.     transmit "D^M"
  256.   WHEN 0 "would you like to" call TOM1
  257.   WHEN 1 "tomcat menu" transmit "G^M"
  258.   WHILE CONNECTED
  259.   ENDWHILE
  260.   EXIT
  261.  
  262. ENDPROC
  263.  
  264. PROC TOM1
  265.    transmit "Y^M"
  266.    waitfor ".QWK" forever
  267.      if N2==1
  268.        DOS "xfer "
  269.       endif
  270. ENDPROC
  271.  
  272.