home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / finance / ozquote4.zip / QUOTE4.SCR
Text File  |  1993-09-06  |  5KB  |  164 lines

  1. ; QUOTE4.SCR
  2. ; Original script written by Herbert K. Barnett 71045,3307
  3. ; Modified 08/07/93 by Chris Clementson 72050,2635
  4.  
  5. ; This OzCIS script captures quotes from CompuServe's BASICQUOTE service and
  6. ; saves them to a stand-alone text file named ``QUOTES.TXT'' (the name of the
  7. ; file can be changed, if desired).  It overwrites the previous session's
  8. ; quote file, so your quotes are always up-to-date.  It also captures quotes
  9. ; slightly quicker than previous versions by going directly to BASICMONEY.  
  10. ; The bug that prevented previous versions from capturing more than two quote 
  11. ; strings per session has been fixed.
  12. ;
  13. ;                                               - Chris Clementson 72050,2635
  14.  
  15.  
  16. ; NOTE THAT THIS SCRIPT WILL HANDLE A MAXIMUM OF ONLY 19 tickers per
  17. ; pass thru BasicQuotes, not the 20 allowed by CIS.  This is to
  18. ; avoid a script problem that occurs with the change in prompt
  19. ; if the maximum 20 ticker symbols are sent.  The script language
  20. ; cannot accommodate an either/or WAIT condition, so the strings of
  21. ; ticker symbols must be at least one less than the maximum CIS allows.
  22.  
  23. ; Set up a graceful exit if an error occurs.
  24. ONERROR ErrorHandler
  25.  
  26. ;********************  DEFINE ALL VARIABLES HERE  **********************
  27.  
  28. ; Set pass counter
  29. SET #0 "1"
  30.  
  31. ; This is the number of ticker strings (defined below) to send.
  32. SET #9 "9"
  33.  
  34. ; Define the ticker symbol strings to be sent.  Strings $1 through $9
  35. ; can be used, and must be used in numerical sequence.
  36. ; Enter the ticker symbols for the stocks, funds or market
  37. ; indexes you desire.  Separate the symbols with commas,
  38. ; and do not embed spaces in the string.
  39.  
  40. ; DO NOT include more than  --> 19 <-- tickers in any string!
  41.  
  42. SET $1 "DJ 30,SP 500,COMP,ALD,AA,AXP,T,BS,BA,CAT,CHV,KO,DD,EK,DIS,XON,GE,GM,GT"
  43. SET $2 "IBM,IP,MCD,MRK,MMM,JPM,MO,PG,S,TX,UK,UTX,WX,Z"
  44. ; Additional strings can be defined as needed.  Remember to change
  45. ; the value of variable #9 above, to match the number of ticker strings
  46. ; to be sent
  47. SET $3 "APCC,CNR,DELL,MSFT"
  48. SET $4 "BDG,BORL,BNI"
  49. SET $5 "BS,CAG,CCC,CHV"
  50. SET $6 "CNG,CP,CRUS,CSCO"
  51. SET $7 "DELL,DD,EAT,EQT"
  52. SET $8 "FLR,FSI,FSS,G,GE,GLX"
  53. SET $9 "GT,LGNT,KM,KSU,LIZ,LUB,MCN"
  54.  
  55. ;Set timeout interval in seconds
  56. TIMEOUT 30
  57.  
  58. ; Change the following "N" to "Y" if you want the script to ASK if
  59. ; it should capture stock quotes, instead of running automatically.
  60. ; You MUST use a capital "Y", not lowercase, to GOSUB Pinquiry.
  61. SET $0 "N"
  62. IF $0 = "Y" GOSUB Pinquiry
  63.  
  64. ;*************** THIS PART OF THE SCRIPT GETS EXECUTED ON-LINE ***************
  65.  
  66. ;Go to BASICMONEY
  67. LSEND "GO BASICMONEY"
  68.  
  69. ;Select (or re-select for additional passes) Basic Quotes
  70. GetQuotes:
  71. WAIT "!"
  72. LSEND "1"
  73.  
  74. WAIT "Issue:"
  75.  
  76. ; When capturing the first ticker string, the previous session's quote file
  77. ; will be overwritten (as designated by the /O suffix) and a mail message
  78. ; header will be written.  You can change the name of the output quote file
  79. ; by substituting your own file name for ``QUOTES.TXT''.
  80. IF #0 = "1" LSEND $1
  81. IF #0 = "1" CAPTURE ON "QUOTES.TXT" /O
  82. IF #0 = "1" WMH
  83.  
  84. ;When capturing subsequent ticker strings, quotes will be appended to the
  85. ;current quote file
  86. IF #0 = "2" LSEND $2
  87. IF #0 = "2" CAPTURE ON "QUOTES.TXT"
  88.  
  89. IF #0 = "3" LSEND $3
  90. IF #0 = "3" CAPTURE ON "QUOTES.TXT"
  91.  
  92. IF #0 = "4" LSEND $4
  93. IF #0 = "4" CAPTURE ON "QUOTES.TXT"
  94.  
  95. IF #0 = "5" LSEND $5
  96. IF #0 = "5" CAPTURE ON "QUOTES.TXT"
  97.  
  98. IF #0 = "6" LSEND $6
  99. IF #0 = "6" CAPTURE ON "QUOTES.TXT"
  100.  
  101. IF #0 = "7" LSEND $7
  102. IF #0 = "7" CAPTURE ON "QUOTES.TXT"
  103.  
  104. IF #0 = "8" LSEND $8
  105. IF #0 = "8" CAPTURE ON "QUOTES.TXT"
  106.  
  107. IF #0 = "9" LSEND $9
  108. IF #0 = "9" CAPTURE ON "QUOTES.TXT"
  109.  
  110. ; This prompt would need to be changed from "Issue:" to "!" if the
  111. ; script included a ticker symbol string with 20 symbols.
  112. WAIT "Issue:"
  113. CAPTURE OFF
  114.  
  115. ; As configured, this script will capture the ENS blurb (if any) and any 
  116. ; messages alerting you that a ticker symbol cannot be found in BASICQUOTE.
  117.  
  118. ;Return to BASICMONEY
  119. SEND ^M
  120.  
  121. ;If more strings to send, loop back.  Otherwise, script terminates.
  122. IF #0 = #9 JUMP Done
  123. INC #0
  124. JUMP GetQuotes
  125.  
  126. Done:
  127. WAIT "!"
  128.  
  129. ;Log off
  130. END
  131.  
  132. ;************************** END OF ON-LINE SESSION **************************
  133.  
  134. Pinquiry:
  135.     ; Asks if you want stock quotes before running the script.
  136.     ; This allows QUOTES.SCR to be run automatically each first
  137.     ; pass while still allowing you to bypass gathering quotes on
  138.     ; weekends, or if you make more than one first pass in one day.
  139.     ; Note that answering  Y  or  y  runs the script, any other keypress
  140.     ; cancels the script and continues with your first pass.
  141.     ;
  142.     ; To execute QUOTES.SCR automatically, enter this filename
  143.     ; under the Prescript field in the Host configuration page.
  144.   CLS
  145.   LWRITE " "
  146.   LWRITE " "
  147.   LWRITE " "
  148.  
  149.   PROMPT $0 "  Do you want to capture today's stock quotes? (Y/N)"
  150.   UPCASE $0
  151.   IF $0 = "Y" RETURN
  152.  
  153.   LWRITE " "
  154.   LWRITE " "
  155.   LWRITE " "
  156.   LWRITE "   ---------------Continuing with the First Pass----------------"
  157.   END
  158.  
  159. ; This closes the capture file and terminates the script
  160. ; in the event of a problem.
  161. ErrorHandler:
  162. CAPTURE OFF
  163. FAIL
  164.