home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3594 / .uni < prev    next >
Encoding:
Text File  |  1991-07-11  |  1.1 KB  |  52 lines

  1. #.uni
  2. # sample script to call CompuServe, go to the UnixForum,
  3. # and enter terminal mode
  4.  
  5.     debug "on"        # turn on verbose script reporting
  6.     tty "on"        # echo received characters to screen
  7.     set bps 2400    # numbers don't need literal quotes
  8.  
  9.     if ! linked; then        # dial if we haven't already
  10.         dial "9687790"
  11.     endif
  12.  
  13.     while ! waitfor "CONNECT" 35    # redial forever
  14.     do
  15.         redial
  16.     done
  17.  
  18.     pause 2                # wait for network to catch up
  19.  
  20.     # wait for a "User ID" prompt, but put a cap on how long
  21.     transmit "^C"
  22.     assign counter eq 1
  23.     while ! waitfor " ID" 20
  24.     do
  25.         incr counter
  26.         if counter morethan 5; then quit; endif
  27.         transmit "^C"
  28.     done
  29.  
  30.     pause 2                # wait for network to catch up
  31.     transmit "72160,1341^M"        # send user ID number (PPN)
  32.  
  33.     # if no "Password:" prompt in 20 seconds, bomb out
  34.     if ! waitfor "word" 20 ; then quit; endif
  35.  
  36.     pause 1; transmit "My*Password^M"
  37.  
  38.     waitfor "!" 20
  39.  
  40.     transmit "g unixfo^M"
  41.  
  42.     # if we don't see "Welcome", we're not in the Forum
  43.     if ! waitfor "Welcome" 20
  44.     then                # <- NEVER forget the "then"!
  45.         transmit "bye^M"
  46.         quit            # this is total program death
  47.     else
  48.         beep            # just a personal touch
  49.     endif
  50.  
  51.     exit                # enter terminal mode
  52.