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

  1. #:
  2. #:TeleTym
  3. .LOGON
  4. #########################  TELENET OR TYMNET    #############################
  5. #
  6. #  This Telenet/Tymnet script will connect a user to either of these services
  7. #  without specifing which one you are actually calling.  The script will
  8. #  detect the service and leave the user at the respective prompt.
  9. #
  10. #  You may incorporate this script into the systems.scr script, use it as a 
  11. #  stand alone systems script or as a regular script.  If you choose to insert
  12. #  this script into systems.scr you must make three modifications.  When the
  13. #  systems.scr (or modems.scr) files are indexed our index utility is looking
  14. #  specifically for colons; therefore, the # must be deleted from the first
  15. #  two lines and from the last line of this file.  Once these items have been
  16. #  changed, copy this script into systems.scr and re-index (See the Users 
  17. #  manual for instructions on the index utility).
  18. #
  19. #############################################################################
  20. #
  21. #
  22. connect                               # make the connection    
  23. if @status not = "0"                  # if no connection - return with error
  24.    write "connection not estabished"
  25.    write "TELETYM SCRIPT ABORTED"
  26.    return 1
  27.    end
  28. reps 4                                # try four times
  29. ttrap 2,"second wait"
  30. #
  31. #
  32. .first                                # try and detect telenet or tymnet
  33. if @baudrate not = "1200"
  34.    tsend "a","@"
  35.    end
  36. else
  37.    tsend "a",cr
  38.    end
  39. .second
  40. tsend cr
  41. ttrap 8, "TERMINAL=","identifier","@","in:","ame:"
  42. if @status = "3" or @status = "4" or @status = "5"  return 0
  43. if @status = "2"
  44.    tsend "a"
  45.    ttrap 5,"in:"
  46.    if @status = "1"  return 0
  47.    goto .second
  48.    end
  49. if @status = "1"                      # telenet detected
  50.    goto .second
  51.    end
  52. if @status = "0"                      # if nothing recognized
  53.    if reps                            #    try again
  54.       goto .first
  55.       end
  56.    write "could not get into network" # else
  57.    write "TELETYM SCRIPT ABORTED"     #    write an error message
  58.    return 1                           #    return with error
  59.    end
  60. return 1
  61. #
  62. #
  63. .LOGOFF
  64.  return 0
  65. .UPLOAD
  66.  write "Uploads not available with this system script"
  67.  return 0
  68. .TRANSFER
  69.  write "Filetransfer not available with this system script"
  70.  return 0
  71. .END
  72. #:
  73.  
  74.