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

  1. #:
  2. #:Delphi
  3. .LOGON
  4. #################################  DELPHI  ###################################
  5. #
  6. #  This Delphi script will connect a user to the Delphi service direct or
  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 Delphi 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 "DELPHI 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,tymnet or direct
  37. if @baudrate not = "1200"
  38.    tsend "a","@"
  39.    end
  40. else
  41.    tsend "a",cr
  42.    end
  43. tsend cr
  44. ttrap 8, "MINAL=","identif","log in:"," name:","Username:","Password:","fail"
  45. if @status = "5" or @status = "6" or @status = "7"  goto .delphi # direct 
  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 "DELPHI 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 2, "nothing"
  64. goto .get_delphi
  65. #
  66. #
  67. .telenet                              # set for telenet
  68. set @thru = "tel"
  69. #
  70. #
  71. .get_delphi                           # get service
  72. if @thru = "tym"                      # through tymnet
  73.    tsend "delphi",cr
  74.    end
  75. else                                  # through telenet
  76.    tsend "c delphi",cr
  77.    end
  78. ttrap 8, "Username","@"," name:","log in:"
  79. if @status = "2" or @status = "3" or @status = "4"  goto .get_delphi
  80. if @status = "0"                      # if nothing was recognized
  81.    if reps                            #    and reps try again
  82.       goto .get_delphi
  83.       end
  84.    write "could not obtain service"   # else
  85.    write "DELPHI SCRIPT ABORTED"      #    write an error message
  86.    return 1                           #    return with error
  87.    end
  88. #
  89. #
  90. .delphi                               # log into delphi
  91. if @userid = ""  return 0             # send userid
  92. tsend @userid 
  93. .log_in
  94. tsend cr
  95. ttrap 12,"Password:","Username:","fail","@"," name:","log in:","DELPHI"
  96. if @status = "1"                      # send password
  97.    if @password = ""  return 0
  98.    tsend @password
  99.    goto .log_in
  100.    end
  101. if @status = "2"  goto .delphi        # try again
  102. if @status = "3"
  103.    tsend cr
  104.    goto .delphi
  105.    end
  106. if @status = "4" or @status = "5" or @status = "6"  goto .get_delphi
  107. if @status = "6"  return 0            # ok, return
  108. if @status = "0"                      # if nothing was recognized
  109.    if reps                            #    and reps try again
  110.       goto .log_in
  111.       end
  112.    write "could not log in"           # else
  113.    write "DELPHI SCRIPT ABORTED"      #    write an error message
  114.    return 1                           #    return with error
  115.    end
  116. return 1
  117. #
  118. #
  119. .LOGOFF
  120.  tsend "exit",cr
  121.  ttrap 30, "@","in:"," name","NO CARRIER"
  122.  if @status = "0"  return 1
  123.  return 0
  124. .UPLOAD
  125.  write "Uploads not available on Delphi with this system script"
  126.  return 0
  127. .TRANSFER
  128.  write "Filetransfer not available on Delphi with this system script"
  129.  return 0
  130. .END
  131. #:
  132.  
  133.