home *** CD-ROM | disk | FTP | other *** search
/ .net 1999 December / netCD65.iso / pc / Software / VirtualA / 32bit / vasetup.exe / %MYDIR% / WEATHER.EBS < prev    next >
Encoding:
Text File  |  1999-10-06  |  9.4 KB  |  351 lines

  1. 'T:WEATHER.EBS for CompuServe
  2. ' VA 4.52 release
  3.  
  4. Global Const IM_DELETE  = 2048
  5.  
  6. Declare Function ParseString(args As String, delim As String) As String
  7. Declare Function StartCapture(pseudo As String)
  8. Declare Function QueueFile(service As String, sfilename As String, queueflags As Long) As Boolean
  9. Declare Sub ResetForum
  10. Declare Function FileUrl(fn As String) As String
  11. Public Success As Boolean
  12.  
  13. 'T:WeatherLink (subroutine) (CompuServe)
  14. Sub WeatherLink(subj As String, fn As String)
  15.     Dim tmpfn As String, b As Boolean
  16.  
  17.     tmpfn = StartCapture("Weather/Maps CompuServe")
  18.     CaptureText subj+Basic.Eoln$
  19.     CaptureText Basic.Eoln$+"Downloaded to "+FileUrl(fn)+Basic.Eoln$
  20.     CaptureText "!end"+Basic.Eoln$
  21.     Capture CAPTURE_OFF
  22.     b = QueueFile(Session.Service, tmpfn, IM_DELETE)
  23. End Sub
  24.  
  25. 'T:LocalWeather (subroutine) (CompuServe)
  26. Sub LocalWeather(id As String)
  27.     Dim filename As String
  28.  
  29.     ' Start from a known place that works
  30.     GoTop
  31.     GoTop
  32.     Comms.Send "weather\r"
  33.     WaitFor "weather\r"
  34.     filename = StartCapture("Weather/Local_Weather CompuServe")
  35.     WaitFor "\nEnd of report !"
  36.  
  37.     ' Clear up
  38.     CaptureRewind 16
  39.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  40.     Capture CAPTURE_OFF
  41.     Comms.Send "\r"
  42.     WaitForPrompt "Prompt"
  43.  
  44.     ' Add to import queue
  45.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  46.         ReportSuccess id & " : Local weather report collected"
  47.     End If
  48. End Sub 
  49.  
  50. 'T:USWeather (subroutine) (CompuServe)
  51. Sub USWeather(id As String, map As String)
  52.     
  53.     menuitem = ParseString(map, " ")    'menuitem = "15"
  54.     fname = ParseString(map, " ")       'fname = "NEUS"
  55.         
  56.     Comms.Send "go cis:usmaps\r"
  57.     WaitForPrompt "Prompt"
  58.     Comms.Send "go cis:usmaps\r"
  59.     WaitFor "\n"
  60.     Terminal.Status "Entering Weather Area ... Please Wait"
  61.     Terminal.Enabled=False
  62.     WaitForPrompt "PromptMain" 
  63.     Terminal.Status "Selecting Weather Map ... Please Wait"
  64.     Comms.Send "1\r"
  65.     WaitForPrompt "Prompt" 
  66.     Comms.Send menuitem + "\r"
  67.     WaitForPrompt "PromptMain" 
  68.     Comms.Send "2\r" 
  69.     WaitFor "(<CR> for default) :"
  70.     Comms.Send fname + ".gif\r"
  71.     WaitForPrompt "Prompt"
  72.     Terminal.Enabled=True
  73.     WeatherLink "US Weather Map", fname+".gif"
  74.  
  75.     ReportSuccess id & " US Weather Map " & map & " collected"
  76. End Sub
  77.  
  78. 'T:WorldWeather (subroutine) (CompuServe)
  79. Sub WorldWeather(id as String, map as String)
  80.  
  81.     menuitem = ParseString(map, " ")   'menuitem = "15"
  82.     fname = ParseString(map, " ")      'fname = "NEUS"     
  83.   
  84.     'General go to usmaps and get to other regions
  85.     Comms.Send "go cis:usmaps\r" 
  86.     WaitForPrompt "Prompt"
  87.     Comms.Send "go cis:usmaps\r"
  88.     WaitFor "\n"
  89.     Terminal.Status "Entering Weather Area ... Please Wait"
  90.     Terminal.Enabled=False
  91.     WaitForPrompt "PromptMain" 
  92.     Comms.Send "1\r"
  93.     Terminal.Status "Selecting Weather Map ... Please Wait"
  94.     WaitForPrompt "Prompt"
  95.     Comms.Send "3\r"
  96.     WaitForPrompt "Prompt" 
  97.  
  98.     Comms.SendLiteral menuitem
  99.     Comms.Send "\r"
  100.     WaitForPrompt "PromptMain"
  101.     Terminal.Status "Preparing to Download File(s) ... Please Wait" 
  102.     
  103.     'Determine which country from number to be passed
  104.     'Each country has a different series of maps, but all europe is same number
  105.  
  106.     Select Case menuitem
  107.     
  108.     '2 Canada
  109.     Case 2 
  110.         Comms.Send "3\r"
  111.         WaitForPrompt "Prompt"
  112.         Comms.Send "2\r" 
  113.         WaitFor "(<CR> for default) :"
  114.         Comms.Send fname + "sat.gif"+"\r"
  115.         WaitForPrompt "Prompt"
  116.         WeatherLink "Canada Weather Map", fname+"sat.gif"
  117.     
  118.         Comms.Send "4\r" 
  119.         WaitFor "(<CR> for default) :"
  120.         Comms.Send "pacsat.gif"+"\r"
  121.         WaitForPrompt "Prompt"
  122.         WeatherLink "Canada Weather Map", "pacsat.gif"
  123.     
  124.         Comms.Send "5\r" 
  125.         WaitFor "(<CR> for default) :"
  126.         Comms.Send fname + "curr.gif"+"\r"
  127.         WaitForPrompt "Prompt"
  128.         WeatherLink "Canada Weather Map", fname+"curr.gif"
  129.     
  130.         Comms.Send "6\r" 
  131.         WaitFor "(<CR> for default) :"
  132.         Comms.Send fname + "for.gif"+"\r"
  133.         WaitForPrompt "Prompt"
  134.         WeatherLink "Canada Weather Map", fname+"for.gif"
  135.     
  136.     ReportSuccess id & " : Canada Weather Map collected"
  137.     
  138.     'European
  139.     Case  3,4,5,6,7,8,9,10
  140.         Comms.Send "3\r"
  141.         WaitForPrompt "Prompt"
  142.         Comms.Send "2\r"
  143.         WaitFor "(<CR> for default) :"
  144.         Comms.Send fname + "curr.gif"+"\r"
  145.         WaitForPrompt "Prompt"
  146.         WeatherLink "European Weather Map", fname+"curr.gif"
  147.     
  148.         Comms.Send "4\r" 
  149.         WaitFor "(<CR> for default) :"
  150.         Comms.Send fname + "for.gif"+"\r"
  151.         WaitForPrompt "Prompt"
  152.         WeatherLink "European Weather Map", fname+"for.gif"
  153.     
  154.         Comms.Send "5\r" 
  155.         WaitFor "(<CR> for default) :"
  156.         Comms.Send "eursat.gif"+"\r"
  157.         WaitForPrompt "Prompt"
  158.         WeatherLink "European Weather Map", "eursat.gif"
  159.     
  160.         Comms.Send "6\r" 
  161.         WaitFor "(<CR> for default) :"
  162.         Comms.Send "eurcurr.gif"+"\r"
  163.         WaitForPrompt "Prompt"
  164.         WeatherLink "European Weather Map", "eurcurr.gif"
  165.     
  166.         Comms.Send "7\r" 
  167.         WaitFor "(<CR> for default) :"
  168.         Comms.Send "eurfor.gif"+"\r"
  169.         WaitForPrompt "Prompt"     
  170.         WeatherLink "European Weather Map", "eurfor.gif"
  171.  
  172.     ReportSuccess id & " : European Weather Map collected"
  173.     
  174.     'Middle East
  175.     Case 11
  176.         Comms.Send "3\r"
  177.         WaitForPrompt "Prompt"
  178.         Comms.Send "2\r"
  179.         WaitFor "(<CR> for default) :"
  180.         Comms.Send "mesat.gif"+"\r"
  181.         WaitForPrompt "Prompt"
  182.         WeatherLink "Middle East Weather Map", "mesat.gif"
  183.  
  184.     ReportSuccess id & " : Middle East Weather Map collected"
  185.  
  186.     
  187.     'Japan
  188.     Case 12
  189.         Comms.Send "3\r"
  190.         WaitForPrompt "Prompt"
  191.         Comms.Send "2\r"
  192.         WaitFor "(<CR> for default) :"
  193.         Comms.Send "japsat.gif"+"\r"
  194.         WaitForPrompt "Prompt"      
  195.         WeatherLink "Japan Weather Map", "japsat.gif"
  196.  
  197.         Comms.Send "4\r" 
  198.         WaitFor "(<CR> for default) :"
  199.         Comms.Send "japcurr.gif"+"\r"
  200.         WaitForPrompt "Prompt"
  201.         WeatherLink "Japan Weather Map", "japcurr.gif"
  202.  
  203.         Comms.Send "5\r" 
  204.         WaitFor "(<CR> for default) :"
  205.         Comms.Send "japfor.gif"+"\r"
  206.         WaitForPrompt "Prompt"
  207.         WeatherLink "Japan Weather Map", "japfor.gif"
  208.  
  209.     ReportSuccess id & " : Japan Weather Map collected"
  210.  
  211.     'Australia
  212.     Case 13
  213.         Comms.Send "3\r"
  214.         WaitForPrompt "Prompt"      
  215.         Comms.Send "2\r" 
  216.         WaitFor "(<CR> for default) :"
  217.         Comms.Send "eaussat.gif"+"\r"
  218.         WaitForPrompt "Prompt"      
  219.         WeatherLink "Australia Weather Map", "eaussat.gif"
  220.  
  221.         Comms.Send "4\r" 
  222.         WaitFor "(<CR> for default) :"
  223.         Comms.Send "waussat.gif"+"\r"
  224.         WaitForPrompt "Prompt"
  225.         WeatherLink "Australia Weather Map", "waussat.gif"
  226.  
  227.         Comms.Send "5\r" 
  228.         WaitFor "(<CR> for default) :"
  229.         Comms.Send "auscurr.gif"+"\r"
  230.         WaitForPrompt "Prompt"      
  231.         WeatherLink "Australia Weather Map", "auscurr.gif"
  232.  
  233.         Comms.Send "6\r" 
  234.         WaitFor "(<CR> for default) :"
  235.         Comms.Send "ausfor.gif"+"\r"
  236.         WaitForPrompt "Prompt"      
  237.         WeatherLink "Australia Weather Map", "ausfor.gif"
  238.  
  239.     ReportSuccess id & " : Australia Weather Map collected"
  240.   
  241.     'Mexico
  242.     Case 14
  243.         Comms.Send "3\r"
  244.         WaitForPrompt "Prompt"
  245.         Comms.Send "2\r" 
  246.         WaitFor "(<CR> for default) :"
  247.         Comms.Send "pacsat.gif"+"\r"
  248.         WaitForPrompt "Prompt"      
  249.         WeatherLink "Mexico Weather Map", "pacsat.gif"
  250.     ReportSuccess id & " : Mexico Weather Map collected"
  251.     
  252.     Case Else
  253.         ReportFailure id
  254.             
  255.     End Select 
  256.     
  257.     Terminal.Enabled=True
  258. End Sub
  259.  
  260. 'T:SevereWarning (subroutine) (CompuServe)
  261. Sub SevereWarning(id As String, warning As String)
  262.     
  263.     Dim filename As String
  264.     menuitem = ParseString(warning, " ")   'menuitem = 3 char code
  265.    
  266.     ResetForum
  267.     GoTop
  268.     Comms.Send "go cis:wea\r"
  269.     WaitFor "hoice!"
  270.  
  271.     Comms.Send "sw " + menuitem + "\r" 
  272.     Terminal.Status "Collecting Severe Weather Report"
  273.     Terminal.Enabled = False
  274.     WaitFor "sw "
  275.     filename = StartCapture("Weather/Severe_Weather CompuServe")
  276.     WaitFor "ID:"
  277.  
  278.     ' Clear up
  279.     CaptureRewind 3
  280.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  281.     Capture CAPTURE_OFF
  282.     Comms.Send "exit\r"
  283.     Terminal.Enabled = True
  284.     WaitForPrompt "Prompt"
  285.  
  286.     ' Add to import queue
  287.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  288.         ReportSuccess id & " : Severe Weather information collected"
  289.     End If
  290. End Sub 
  291.  
  292.  
  293. 'T:ExtStateWeather (subroutine) (CompuServe)
  294. Sub StateWeather(id As String, where As String)
  295.     
  296.     Dim filename As String
  297.     
  298.     state=UCase$(where)
  299.     
  300.     ResetForum
  301.     Comms.Send "go cis:wea\r"
  302.     WaitFor "hoice!"
  303.  
  304.     Comms.Send "ef " + state + "\r"
  305.     Terminal.Status "Collecting State Weather Report"
  306.     Terminal.Enabled = False
  307.     WaitFor "ef "
  308.     filename = StartCapture("Weather/State_Weather CompuServe")
  309.     WaitFor "ID:"
  310.  
  311.     ' Clear up
  312.     CaptureRewind 3
  313.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  314.     Capture CAPTURE_OFF
  315.     Comms.Send "exit\r"
  316.     Terminal.Enabled = True
  317.     WaitForPrompt "Prompt"
  318.  
  319.     ' Add to import queue
  320.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  321.         ReportSuccess id & " : State (" & where & ") weather collected"
  322.     End If
  323. End Sub
  324.  
  325. 'T:NewLocalWeather (subroutine) (CompuServe)
  326. Sub NewLocalWeather(id As String, location As String)
  327.   Dim filename As String
  328.  
  329.     ' Start from a known place that works
  330.     GoTop
  331.     GoTop
  332.     Comms.Send "weather " + location +  "\r"
  333.     WaitFor "weather " + location +  "\r"
  334.     filename = StartCapture("Weather/Local_Weather CompuServe")
  335.     WaitFor "\nEnd of report !"
  336.  
  337.     ' Clear up
  338.     CaptureRewind 16
  339.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  340.     Capture CAPTURE_OFF
  341.     Comms.Send "\r"
  342.     WaitForPrompt "Prompt"
  343.  
  344.     ' Add to import queue
  345.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  346.       ReportSuccess id & " : " + location + " weather report collected"
  347.     End If
  348. End Sub
  349.  
  350.  
  351.