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

  1. #:
  2. #:NewsNet
  3. .LOGON
  4. ################################  NEWSNET  ##################################
  5. #
  6. #  This Newsnet script will connect a user to the Newsnet service 
  7. #  through Telenet or Tymnet.  It will detect the network you are calling
  8. #  through so no modifications to the script are necessary.  The automatic 
  9. #  login process is dependent on the userid and password of the current set 
  10. #  up file, it should contain your Newsnet ID and password.  If either of
  11. #  these are null the script will return control to the user to complete the 
  12. #  log in manually.  Hint: watch out for blank characters in this field.
  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 "NEWSNET SCRIPT ABORTED"
  30.    return 1
  31.    end
  32. reps 4                                # try four times
  33. ttrap 2,"second wait"
  34. #
  35. #
  36. .begin                                # try and detect telenet or tymnet
  37. if @baudrate not = "1200"
  38.    tsend "a","@"
  39.    end
  40. else
  41.    tsend "a",cr
  42.    end
  43. tsend cr
  44. .identify
  45. ttrap 8, "MINAL=","identifier","log in:","ame:"
  46. if @status = "2"  tsend "a"           # if status = 2,3,4 then tymnet detected
  47. if @status = "1"                      # if status = 1 then telenet detected
  48.    tsend cr
  49.    goto .telenet
  50.    end
  51. if @status = "0"                      # if nothing
  52.    if reps                            #    and reps try again
  53.       goto .begin
  54.       end
  55.    write "could not get into network" # else
  56.    write "NEWSNET SCRIPT ABORTED"     #    write an error message
  57.    return 1                           #    return with error
  58.    end
  59. #
  60. #
  61. .tymnet                               # set for tymnet
  62. set @thru = "tym"
  63. ttrap 3, "nothing"
  64. goto .newsnet
  65. #
  66. #
  67. .telenet                              # set for telenet
  68. set @thru = "tel"
  69. #
  70. #
  71. .newsnet                              # connect to newsnet service
  72. if @thru = "tym"                      # through tymnet
  73.    tsend "net"
  74.    end
  75. else                                  # through telenet
  76.    tsend "c net"
  77.    end
  78. .log_in_process                       # begin newsnet login loop
  79. tsend cr
  80. ttrap 12, "-->","word?","@","ame:","log in:","NNNNNNNNNN"
  81. if @status = "1"                      # send id
  82.    if @userid = ""  return 0
  83.    tsend @userid
  84.    goto .log_in_process
  85.    end
  86. if @status = "2"                      # send password
  87.    if @password = ""  return 0
  88.    tsend @password
  89.    goto .log_in_process
  90.    end
  91. if @status = "3" or @status = "4" or @status = "5"  goto .newsnet
  92. if @status = "6"  return 0            # ok, return
  93. if @status = "0"                      # if nothing was recognized
  94.    if reps                            #    and reps try again
  95.       goto .log_in_process 
  96.       end
  97.    write "could not log in"           # else
  98.    write "NEWSNET SCRIPT ABORTED"     #    write an error message
  99.    return 1                           #    return with error
  100.    end
  101. return 1
  102. #
  103. #
  104. .LOGOFF
  105.  tsend "exit",cr
  106.  ttrap 30, "@","in:"," name","NO CARRIER"
  107.  if @status = "0"  return 1
  108.  return 0
  109. .UPLOAD
  110.  write "Uploads not available on NewsNet with this system script"
  111.  return 0
  112. .TRANSFER
  113.  write "Filetransfer not available on NewsNet with this system script"
  114.  return 0
  115. .END
  116. #:
  117.  
  118.