home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / OS2SHASP.ZIP / OS2SHARE.ASP
Text File  |  1992-01-20  |  4KB  |  112 lines

  1. ; ***********************************************************************
  2. ; *                                                                     *
  3. ; *                             OS2SHARE.ASP                            *
  4. ; *                       by Roy M. Randall  01/19/92                   *
  5. ; *                                                                     *
  6. ; * A Procomm Plus Aspect script language file to automate the use of   *
  7. ; * the Offline Reader function of the OS/2 Shareware BBS, a Maximus    *
  8. ; * BBS system.  Zmodem is the default protocol.  The modem is set up   *
  9. ; * to return verbose replies.  The upload and download files are       *
  10. ; * expected to be in the D:\ directory.  The path names in GETMAIL     *
  11. ; * and SENDMAIL should be edited to match your preferences.  The modem *
  12. ; * settings in DIALUP may need changing also.                          *
  13. ; *                                                                     *
  14. ; ***********************************************************************
  15.  
  16. PROC MAIN                ; Main Loop
  17.  
  18.   ASSIGN S0 "385-0931"            ; first phone number.
  19.   ASSIGN S1 "385-4325"            ; second phone number.
  20.   ASSIGN S2 "USER NAME^M"        ; User's name.
  21.   ASSIGN S3 "PASSWORD^M"        ; User's password.
  22.  
  23.   WHEN 0 "Press ENTER to continue" TRANSMIT "^M"
  24.  
  25.   IF NOT FROMDDIR            ; if called from the command line or
  26.     CALL DIALUP                ; Alt-F5, manual dial.
  27.   ENDIF
  28.   CALL LOGON                ; Log on to BBS.
  29.   WAITFOR "Select:"            ; Main Menu.
  30.   TRANSMIT "O^M"            ; Go to the Offline Reader Menu.
  31.   WAITFOR "READER:"            ; Make sure we're there.
  32.   WAITFOR "Select:"            ; Offline Reader Menu.
  33.   CALL SENDMAIL                ; send stuff.
  34.   WAITFOR "Select:" 10            ; Short timeout, this one gets missed.
  35.   CALL GETMAIL                ; get stuff.
  36.   CALL LOGOFF                ; get out.
  37.   WAITFOR "NO CARRIER"
  38.   QUIT                    ; exit Procomm Plus
  39. ENDPROC
  40.  
  41. PROC DIALUP                ; Manual dial.
  42.   SET BAUD 2400                ; Explicitly set up terminal
  43.   SET PARITY NONE            ; because we haven't called this
  44.   SET DATABITS 8            ; from the Dial Directory.
  45.   SET STOPBITS 1
  46.   SET DUPLEX FULL
  47.   SET PORT COM2
  48.   SET EMULATION ANSI
  49.   DIALIT:                ; This loop does the dialing.
  50.   MDIAL S0                ; If the first number is busy,
  51.   IF NOT SUCCESS            ; the user can hit <Esc> and
  52.     MDIAL S1                ; the script will try the second
  53.     IF NOT SUCCESS            ; number.  <Esc> again will toggle
  54.       GOTO DIALIT            ; back to the first number.
  55.     ENDIF
  56.   ENDIF
  57. ENDPROC
  58.  
  59. PROC LOGON                ; Logs user into the BBS system.
  60.   PAUSE 4
  61.   LOOP:
  62.   TRANSMIT "^M^M"            ; knock, knock.
  63.   WAITFOR "BBS, or wait 10 seconds." 1
  64.   IF NOT WAITFOR
  65.     GOTO LOOP                ; I said, KNOCK, KNOCK, dammit!!
  66.   ENDIF
  67.   TRANSMIT "^["                ; send Escape character, ASCII 27
  68.   WAITFOR "name:" 120            ; who's there?
  69.   TRANSMIT S2                ; send user's name.
  70.   WAITFOR "Y"                ; BBS echos name.
  71.   TRANSMIT "Y^M"            ; yes, it's ME, dammit!
  72.   WAITFOR "Password:"            ; prove it!
  73.   TRANSMIT S3                ; send user's password.
  74.   WAITFOR "mail? [Y,n]" 120        ; skip the mail check
  75.   TRANSMIT "N^M"
  76.   WAITFOR "files? [Y,n]"        ; and the file check.
  77.   TRANSMIT "N^M"
  78. ENDPROC
  79.  
  80. PROC SENDMAIL                ; Uploads Reply Packet
  81.   ISFILE "D:\OS2SHARE.REP"        ; Is there anything to send?
  82.   IF SUCCESS                ; if so,
  83.     TRANSMIT "U^M"            ; tell the BBS,
  84.     PAUSE 4
  85.     SENDFILE ZMODEM "D:\OS2SHARE.REP"    ; and do it.
  86.     IF SUCCESS                ; Did it work?
  87.       DOS "DEL D:\OS2SHARE.REP" NOCLEAR    ; then we won't need this anymore.
  88.     ENDIF
  89.   ENDIF                    ; if not,
  90. ENDPROC                    ; forget it.
  91.  
  92. PROC GETMAIL                ; Downloads the Mail Packet.
  93.   TRANSMIT "D^M"            ; Request a Mail Packet,
  94.   ISFILE "D:\OS2SHARE.QWK"        ; Is there an old one around?
  95.   IF SUCCESS                 ; if so, delete the oldest,
  96.     DOS "DEL D:\OS2SHAR2.*" NOCLEAR    ; and rename the others.
  97.     DOS "REN D:\OS2SHAR1.* OS2SHAR2.*" NOCLEAR
  98.     DOS "REN D:\OS2SHARE.* OS2SHAR1.*" NOCLEAR
  99.   ENDIF
  100.   WAITFOR "QWK format [Y,n]?" 300    ; Wait while the BBS searches.
  101.   TRANSMIT "Y^M"            ; Confirm the download.
  102.   WAITFOR "Select:" FOREVER        ; this could take a while.
  103. ENDPROC
  104.  
  105. PROC LOGOFF                ; Let's get outta here!
  106.   TRANSMIT "G^M"            ; bye-bye
  107.   WAITFOR "Disconnect [Y,n,?=help]?"    ; are we sure?
  108.   TRANSMIT "Y^M"            ; YES, DAMMIT!
  109.   WAITFOR "[y,N,?=help]?"        ; leave our host a message?
  110.   TRANSMIT "N^M"            ; Not tonight, thanks.
  111. ENDPROC
  112.