home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / TE2SC121.ZIP / Bink2BBS.Scr next >
Text File  |  1992-07-21  |  2KB  |  67 lines

  1. ;; -------------------------------------------------------------------------
  2. ;;
  3. ;; Bink2BBS.Scr -- Copyright (c) 1992, Oberon Software, Mankato Mn
  4. ;;                 Author: Brady Flowers, 07/19/92
  5. ;;
  6. ;; This little script is designed to get us through the BinkleyTerm
  7. ;; conversation and into the BBS.  This should work with a variety of
  8. ;; FidoNet BBSes.  It is tested with Pete Norloff's OS/2 Shareware BBS
  9. ;; and with the Oberon Support BBS.  The thing that will break it is
  10. ;; the waitfor("Thank you", 3) statement if a sysop does not transmit
  11. ;; a string containing the words "Thank you" once the user has pressed
  12. ;; ESCape to enter the BBS.
  13. ;;
  14. ;; -------------------------------------------------------------------------
  15.  
  16. global integer fGotBBS  ;; Caller must declare this global variable if it
  17. integer i               ;; wants to test the success or failure
  18.  
  19.  
  20. subroutine GetBBS
  21.  
  22.   fGotBBS = FALSE  ;; All primed for failure
  23.  
  24.   ;; Try five times to cajole Bink into sending its initial banner by
  25.   ;; transmitting space characters, one every two seconds.
  26.   i = 0
  27.   do while i < 5
  28.     sendbyte(' ')
  29.     if waitfor("Address", 3)
  30.       break
  31.     else
  32.       i = i + 1
  33.       sleep(2000)
  34.     endif
  35.   loop
  36.  
  37.   ;; If i is less than 5, then we got the Bink banner, now do the same
  38.   ;; thing with ESCape characters to tell Bink we want the BBS.  See the
  39.   ;; comment above regarding testing for "Thank you" here.
  40.   if i < 5
  41.     i = 0
  42.     do while i < 5
  43.       sendbyte('^[')
  44.       if waitfor("Thank you", 3)
  45.         break
  46.       else
  47.         i = i + 1
  48.         sleep(2000)
  49.       endif
  50.     loop
  51.  
  52.     ;; If i is less than 5 here, it means Bink said "Thank you" and we
  53.     ;; should be going into the BBS now.
  54.     if i < 5
  55.       fGotBBS = TRUE
  56.     endif
  57.  
  58.   endif
  59.  
  60. endsub
  61.  
  62.  
  63. program
  64.   gosub GetBBS
  65.   end
  66.  
  67.