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

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