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

  1. #:
  2. #:GEnie
  3. .LOGON
  4. #################################  GEnie  #####################################
  5. #
  6. #  This GEnie script will connect, log a user in and leave them at the
  7. #  GEnie main menu.  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.  For
  11. #  the userid the user should put in their userid.  The password should contain
  12. #  the users password.  The user does not need to account for the comma between
  13. #  the userid and password.  This script will send the U# string with the comma
  14. #  inserted.
  15. #
  16. #  You may incorporate this script into the systems.scr script, use it as a 
  17. #  stand alone systems script or as a regular script.  If you choose to insert
  18. #  this script into systems.scr you must make three modifications.  When the
  19. #  systems.scr (or modems.scr) files are indexed our index utility is looking
  20. #  specifically for colons; therefore, the # must be deleted from the first
  21. #  two lines and from the last line of this file.  Once these items have been
  22. #  changed, copy this script into systems.scr and re-index (See the Users 
  23. #  manual for instructions on the index utility).
  24. #
  25. ###############################################################################
  26. #
  27. #
  28. connect                               # make the connection    
  29. if @status not = "0"                  # if no connection - return with error
  30.    write "connection not estabished"
  31.    write "GENIE SCRIPT ABORTED"
  32.    return 1
  33.    end
  34. reps 3                                # try three times
  35. ttrap 2,"second wait"
  36. #
  37. #
  38. .begin                                # get U#=
  39. tsend "HHH",cr
  40. ttrap 8, "U#","GEnie"
  41. if @status = "2"  return 0
  42. if @status = "0"                      # if nothing was recognized
  43.    if reps                            #    and reps try again
  44.       goto .begin
  45.       end                         
  46.    write "could not obtain U#= prompt"# else
  47.    write "GENIE SCRIPT ABORTED"       #    write an error message
  48.    return 1                           #    return with error
  49.    end
  50. #
  51. #
  52. .log_in                               # an U#= prompt was detected, log in
  53. if @userid   = ""  return 0
  54. if @password = ""  return 0
  55. tsend @userid,",",@password,cr        # send the log in string
  56. ttrap 10, "U#","GEnie"
  57. if @status = "2"  return 0            # ok, return
  58. if @status = "1" and reps             # try again
  59.    goto .log_in
  60.    end
  61. if @status = "0"                      # if nothing was recognized
  62.    if reps                            #    and reps try again
  63.       goto .begin
  64.       end                         
  65.    write "could not obtain service"   # else
  66.    write "GENIE SCRIPT ABORTED"       #    write an error message
  67.    return 1                           #    return with error
  68.    end
  69. return 1
  70. #
  71. #
  72. .LOGOFF
  73.  tsend "bye",cr
  74.  ttrap 30, "NO CARRIER"
  75.  if @status = "0"  return 1
  76.  return 0
  77. .UPLOAD
  78.  write "Uploads not available on GEnie with this system script"
  79.  return 0
  80. .TRANSFER
  81.  write "Filetransfer not available on GEnie with this system script"
  82.  return 0
  83. .END
  84. #:
  85.  
  86.