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

  1. # autocis - xc script to visit CIS automagically.
  2. # This file uses 4-character tabstops.
  3. # It will log in, visit CIS Mail (if mail is waiting), then the
  4. #  PRACTICE and UNIX Fora, uploading any prepared files, downloading
  5. #  all new messages, and capture into three separate files.
  6. # The following assumptions are made about your CIS interactions:
  7.  
  8. #  You go to MAIL upon login if any mail is waiting.
  9. #  You are in "expert" mode in MAIL.
  10. #  You are in Command mode in all Fora.
  11. #  You have opted for continuous reading in all Fora.
  12. #  You have set your Prompt Char set to '^H' --backspace-- in all Fora.
  13. #    This last is VERY critical to the properly trigger the WAITFORs
  14.  
  15. # The script can be modified to set all of these options on a per/session
  16. # basis if you wish to remain in menu-mode at other times
  17.  
  18. tty "on"        # echo to the tty while script is running
  19. debug "on"        # capture in debug.log providing file pre-exists
  20. set 7bit on        # CIS is happier
  21. set bps 2400
  22. set cis off        # don't trigger on any stray ENQ character
  23. set xoff on        # set XON/XOFF signalling
  24.  
  25. if ! linked; then dial "7662080"; endif    # dial this number
  26. while ! waitfor "2400" 52                # give modem 52 secs to say "2400"
  27.     do
  28.         redial
  29.     done
  30.  
  31. pause 2                        # let network catch up
  32. transmit "^C"                # First thing to send CIS
  33. pause 3                        # let network catch up
  34.  
  35. # Now send CIS one string with PPN, first service to go to, and password
  36. transmit "72160,1341/go:mail\\beige*screw^M"
  37.  
  38. if waitfor "CompuServe Mail^M" 8            # we already asked to GO MAIL
  39. then if ! waitfor "No messages pending" 4    # unless nothing waiting, then
  40.      set cfile "/pub/jpr/comm/email"        # use this capture file
  41.         capture "on"                            # open it
  42.         file echo `date`                        # time stamp it
  43.         transmit "rec all^M"                    # ask to read everything
  44.         while ! waitfor "Mail!"                    #  until this string appears
  45.             do; done                            #  script does nothing
  46.         transmit "del all^M"                # remove msgs from CIS mbox
  47.         capture "off"                        # close the capture file
  48.     fi
  49. else
  50.     beep                            # beep if we never get to CISMail
  51. endif
  52.  
  53. set cfile "/pub/jpr/comm/pra"        # new capture file
  54. transmit "g practice^M"                # new Forum
  55. waitfor "moment please..."            # "Welcome" should follow this
  56. capture "on"                        # start appending to 'pra'
  57. if waitfor "forum !^H" 40            # Prompt with a backspace
  58. then    assign Upload eq `ls rp 2>/dev/null`
  59.     if Upload eq "rp"                # is there an 'rp' file
  60.     then    capture "off"            # then turn off capturing
  61.         type "rp"                    # transmit the 'rp' file
  62.         transmit "^M"                # this extra newline will trigger
  63.         while ! waitfor "% choice required"    # this response after the upload
  64.             do; done
  65.         shell "mv rp /pub/rescue/rp$$"    # rename the 'rp' file
  66.         capture "on"                # start capturing again
  67.     fi
  68.     transmit "rea new^M^M"            # read all new messages
  69.     while ! waitfor "% choice required"
  70.         do; done
  71.     capture "off"
  72. else
  73.     beep                            # beep if Forum closed, or you get bumped
  74. fi
  75.  
  76. set cfile "/pub/jpr/comm/uni"        # same stuff in another Forum
  77. transmit "g unixforum^M"
  78. waitfor "moment please..."
  79. capture "on"
  80. if waitfor "forum !^H" 40
  81. then    assign Upload eq `ls ru 2>/dev/null`
  82.     if Upload eq "ru"
  83.     then    capture "off"
  84.         type "ru"
  85.         transmit "^M"
  86.         while ! waitfor "% choice required"
  87.             do; done
  88.         shell "mv ru /pub/rescue/ru$$"
  89.         capture "on"
  90.     fi
  91.     transmit "rea new^M^M"
  92.     while ! waitfor "% choice required"
  93.         do; done
  94.     capture "off"
  95. else
  96.     beep
  97. fi
  98.  
  99. transmit "off^M"
  100. quit
  101.