It should look like this.
Rem Type=Plugin
Rem Name=USA Weather
Rem Author=Zabaware, Inc.
Rem Host=Assistant
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "Have Hal show your local weather when asked."
lblPlugin(0).Move 120, 120
lblPlugin(0).Visible = True
lblPlugin(1).Caption = "Weather site:"
lblPlugin(1).Move 320, 400
lblPlugin(1).Visible = True
cboPlugin(0).Move 320, 650, 1800
cboPlugin(0).AddItem "Accuweather.com"
cboPlugin(0).AddItem "CNN.com"
cboPlugin(0).AddItem "Weather.com"
cboPlugin(0).AddItem "weather.philly.com"
cboPlugin(0).Visible = True
lblPlugin(2).Caption = "Zip Code:"
lblPlugin(2).Move 320, 1100
lblPlugin(2).Visible = True
txtPlugin(0).Move 320, 1370, 1200, 325
txtPlugin(0).Visible = True
cmdPlugin(0).Caption = "Apply Changes"
cmdPlugin(0).Move 320, 1850, 1600, 375
cmdPlugin(0).Visible = True
If HalBrain.CheckTableExistence("WeatherConfig") = True Then
txtPlugin(0) = HalBrain.TopicSearch("Zip", "WeatherConfig")
WeatherSite = HalBrain.TopicSearch("Site", "WeatherConfig")
If WeatherSite <> "" Then cboPlugin(0).Text = WeatherSite
End If
End Sub
Sub cmdPlugin_Click(Index)
Dim TempQuery()
If Index = 0 Then
If HalBrain.CheckTableExistence("WeatherConfig") = True Then
HalBrain.RunQuery "DROP TABLE WeatherConfig", TempQuery
End If
'Create TopicSearch type table without adding entry to topic tree (table is invisible to Hal Brain Editor)
HalBrain.RunQuery "CREATE TABLE WeatherConfig ( recordId INTEGER PRIMARY KEY, searchString VARCHAR(1024), topic VARCHAR(1024) );CREATE INDEX idxPOP3Config ON POP3Config (searchString);", TempQuery
HalBrain.AddToTable "WeatherConfig", "TopicSearch", "Zip", Trim(txtPlugin(0))
WeatherSite = cboPlugin(0).Text
If WeatherSite <> "" Then HalBrain.AddToTable "WeatherConfig", "TopicSearch", "Site", WeatherSite
End If
End Sub
Rem PLUGIN: PLUGINAREA1
'The comment above tells Ultra Hal Assistant to insert the following code
'on-the-fly into the main brain code in the section referenced.
If InStr(1, UserSentence, "weather", 1) > 0 and (InStr(1, UserSentence, "tell", 1) > 0 Or InStr(1, UserSentence, "open", 1) > 0 Or InStr(1, UserSentence, "how", 1) > 0 Or InStr(1, UserSentence, "what", 1) > 0 Or InStr(1, UserSentence, "show", 1) > 0) Then
If HalBrain.CheckTableExistence("WeatherConfig") = True Then
ZipCode = HalBrain.TopicSearch("Zip", "WeatherConfig")
WeatherSite = HalBrain.TopicSearch("Site", "WeatherConfig")
Select Case weatherSite
Case "Accuweather.com"
HalCommands = HalCommands & "<RUNPROG>http://wwwa.accuweather.com/index-forecast.asp?zipcode=" & ZipCode & "</RUNPROG>"
Case "CNN.com"
HalCommands = HalCommands & "<RUNPROG>http://weather.cnn.com/weather/search?wsearch=" & ZipCode & "</RUNPROG>"
Case "Weather.com"
HalCommands = HalCommands & "<RUNPROG>http://www.weather.com/weather/local/" & ZipCode & "</RUNPROG>"
Case "weather.philly.com"
HalCommands = HalCommands & "<RUNPROG>http://weather.philly.com/US/PA/Philadelphia.html" & "</RUNPROG>"
End Select
HalCommands = HalCommands
GetResponse = GetResponse & "Here is your local weather. "
End If
End If
I spotted an over sight in the default weather code and corrected it and added your weather site as well.
remember to reboot HAL before testing the modifications.
Jerry[8D]