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

  1. #:
  2. #:DowJns
  3. .LOGON
  4. #############################  DOW JONES    #################################
  5. #
  6. #  This Dow Jones script will connect a user to the Dow Jones 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 password of the current set up file,
  10. #  it should contain your Dow Jones password.  If it is null the script will
  11. #  return control to the user to complete the log in manually.  Hint: watch
  12. #  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 "DOW JONES 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, "TERMINAL=","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 "DOW JONES 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 .dow_jones
  65. #
  66. #
  67. .telenet                              # set for telenet
  68. set @thru = "tel"
  69. #
  70. #
  71. .dow_jones                            # connect to dow jones service
  72. if @thru = "tym"                      # through tymnet
  73.    tsend "dow1;;"
  74.    end
  75. else                                  # through telenet
  76.    tsend "c dow",cr
  77.    end
  78. ttrap 8,"PLEASE????","@","ame:","in:"
  79. if @status = "2" or @status = "3" or @status = "4"  # try again
  80.    goto .dow_jones
  81.    end
  82. if @status = "0"                      # if nothing was recognized
  83.    if reps                            #    try again
  84.       tsend cr
  85.       goto .dow_jones 
  86.       end
  87.    write "could not obtain Service"   # else
  88.    write "DOW JONES SCRIPT ABORTED"   #    write an error message
  89.    return 1                           #    return with error
  90.    end
  91. #
  92. #
  93. .service                              # request service
  94. tsend "djns"
  95. .log_in                               # log in
  96. tsend cr
  97. ttrap 4,"PASSWORD","PLEASE????","@","ame:","in:","DOW JONES"
  98. if @status = "1"                      # send password
  99.    if @password = ""  return 0
  100.    ttrap 2,"nothing"
  101.    tsend @password
  102.    goto .log_in
  103.    end
  104. if @status = "2"                      # request service again
  105.    goto .service
  106.    end
  107. if @status = "3" or @status = "4" or @status = "5" 
  108.    goto .dow_jones                    # try again
  109.    end
  110. if @status = "6"  return 0            # ok, return
  111. if @status = "0"                      # if nothing was recognized
  112.    if reps                            #    try again
  113.       goto .log_in 
  114.       end
  115.    write "could not log in"           # else
  116.    write "DOW JONES SCRIPT ABORTED"   #    write an error message
  117.    return 1                           #    return with error
  118.    end
  119. return 1
  120. #
  121. .LOGOFF
  122.  tsend "disc",cr
  123.  ttrap 30, "@","in:"," name","NO CARRIER"
  124.  if @status = "0"  return 1
  125.  return 0
  126. .UPLOAD
  127.  write "Uploads not available on Dow Jones with this system script"
  128.  return 0
  129. .TRANSFER
  130.  write "Filetransfer not available on Dow Jones with this system script"
  131.  return 0
  132. .END
  133. #:
  134.  
  135.