home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / BLST10_2.ZIP / SAMPLES / COMPUSRV.SCR < prev    next >
Encoding:
Text File  |  1990-09-19  |  3.4 KB  |  97 lines

  1. #:
  2. #:CompuSv
  3. .LOGON
  4. #############################  CompuServe  ####################################
  5. #
  6. #  This CompuServe script will connect, log a user in and leave them at the
  7. #  CompuServe command prompt.  The automatic login process is dependent on
  8. #  the userid and password of the current set up file, if either of these 
  9. #  are null the script will return control to the user to complete the log
  10. #  in manually.  Hint: watch out for blank characters in these fields.  Also,
  11. #  if the user wishes to go into PCMAG then there are two lines that must
  12. #  be switched (one is a comment).
  13. #
  14. #  You may incorporate this script into the systems.scr script, use it as a 
  15. #  stand alone systems script or as a regular script.  If you choose to insert
  16. #  this script into systems.scr you must make three modifications.  When the
  17. #  systems.scr (or modems.scr) files are indexed our index utility is looking
  18. #  specifically for colons; therefore, the # must be deleted from the first
  19. #  two lines and from the last line of this file.  Once these items have been
  20. #  changed, copy this script into systems.scr and re-index (See the Users 
  21. #  manual for instructions on the index utility).
  22. #
  23. ###############################################################################
  24. #
  25. #
  26. connect                               # make the connection    
  27. if @status not = "0"                  # if no connection - return with error
  28.    write "connection not estabished"
  29.    write "COMPUSERVE SCRIPT ABORTED"
  30.    return 1
  31.    end
  32. reps 4                                # try three times
  33. ttrap 2,"second wait"
  34. #
  35. #
  36. .login                                # Login to CompuServe
  37. tsend cr
  38. ttrap 7, "ame:","ID:","word:","CompuServe"
  39. if @status = "1"                      # send host
  40.    tsend "cps"
  41.    goto .login
  42.    end
  43. if @status = "2" and reps             # send ID
  44.    if @userid = ""  return 0          # if no userid return control to user
  45.    tsend @userid
  46.    goto .login
  47.    end
  48. if @status = "3" and reps             # send password
  49.    if @password = ""  return 0        # if no password return control to user 
  50.    tsend @password
  51.    goto .login
  52.    end
  53. if @status = "4"                      # login successful !!!
  54.    return 0                           # insert a # for PCMAG or delete line
  55.    #goto .pcmag                       # delete # for PCMAG
  56.    end
  57. if reps                               # if nothing was recognized
  58.    goto .login                        #    try again
  59.    end
  60. else                                  # else
  61.    write "could not log in"           #    write an error message
  62.    write "COMPUSERVE SCRIPT ABORTED"  #    return with error
  63.    return 1
  64.    end
  65. #
  66. #
  67. .pcmag                                # get into PCMAG
  68. tsend "go PCMAG",cr
  69. ttrap 20, "PCMAG"
  70. if @status = "1"                      # if in return ok
  71.    wait 3
  72.    return 0
  73.    end
  74. if @status = "0"                      # if nothing was recognized
  75.    if reps                            #    and reps try again
  76.       tsend cr
  77.       goto .pcmag
  78.       end                         
  79.    write "could not get PCMAGNET"     # else
  80.    write "COMPUSERVE SCRIPT ABORTED"  #    write an error message
  81.    return 1                           #    return with error
  82.    end
  83. return 1
  84. #
  85. #
  86. .LOGOFF
  87.  return 0
  88. .UPLOAD
  89.  write "Uploads not available on CompuServe with this system script"
  90.  return 0
  91. .TRANSFER
  92.  write "Filetransfer not available on CompuServe with this system script"
  93.  return 0
  94. .END
  95. #:
  96.  
  97.