Rem Type=Plugin
Rem Name=Web Surfer
Rem Author=Gerald L. Blakley A.K.A OnTheCuttingEdge2005
Rem Host=Assistant
Rem PLUGIN: PRE-PROCESS
'If the User just types in a Web Address then open that Webpage.
If FindWeb = "" Then FindWeb = HalBrain.SearchPattern(InputString, "*WWW.*.*", 2)
If FindWeb2 = "" Then FindWeb2 = HalBrain.SearchPattern(InputString, "*WWW.*.*", 3)
If FindWeb <> "" And FindWeb2 <> "" Then
HalBrain.ReadOnlyMode = True
HalCommands = "<RUNPROG>" & "http://www." & FindWeb & "." & FindWeb2 & "</RUNPROG>"
HalCommands = HalCommands
End If
Rem PLUGIN: PLUGINAREA1
Set filesys = CreateObject("Scripting.FileSystemObject")
Set HalXBrain = CreateObject("UltraHalAsst.Brain")
Set WordN = CreateObject("UltraHalAsst.WordNet")
'Search for Keywords if the User wants an Image or Picture.
'Example:
'User: Show an Image of an Eagle
'HAL: I have found the following Pictures of an Eagle. HAL then Loads the Pictures.
'You can look into the FileAssistant.uhp for additional Key Expressions for Image searchs on the Internet.
'There are 20 Expressions that HAL will look for When a User wants an Image from the Internet.
'The Prefered Image Look up is through Google Images.
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* IMAGE OF A *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* IMAGE OF AN *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* PICTURE OF A *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* PICTURE OF AN *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* DISPLAY A *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* DISPLAY AN *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "DISPLAY A *", 1)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "DISPLAY AN *", 1)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* PORTRAIT OF A *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* PORTRAIT OF AN *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* PORTRAIT OF *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "PORTRAIT OF A *", 1)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "PORTRAIT OF AN *", 1)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "PORTRAIT OF *", 1)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* PORTRAITS OF A *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* PORTRAITS OF AN *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "* PORTRAITS OF *", 2)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "PORTRAITS OF A *", 1)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "PORTRAITS OF AN *", 1)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "PORTRAITS OF *", 1)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "PICTURES FOR AN *", 1)
If SearchPictures = "" Then SearchPictures = HalBrain.SearchPattern(OriginalSentence, "PICTURES FOR A *", 1)
' Image Search form the above Image Keyword.
'PicSearch = "https://www.google.com/search?q=pictures+" & SearchPictures & "&source=lnms&tbm=isch&sa=X&ei=qPKYU8KjCNSpyATivYCQCQ&ved=0CAkQ_AUoAg&biw=1600&bih=799#q=" & SearchPictures & "&tbm=isch"
If SearchPictures <> "" Then
'PicSearch = "http://www.images.google.com/images?svnum=10&hl=en&lr=&q=" & SearchPictures & "&btnG=Search"
PicSearch = "https://www.google.com/search?q=pictures+" & SearchPictures & "&source=lnms&tbm=isch&sa=X&ei=qPKYU8KjCNSpyATivYCQCQ&ved=0CAkQ_AUoAg&biw=1600&bih=799#q=" & SearchPictures & "&tbm=isch"
HalMenu.HalCommand "<RUNPROG>" & PicSearch & "</RUNPROG>"
GetResponse = "I have found the following Pictures of " & SearchPictures
HalBrain.ReadOnlyMode = True
End If
' Map Search
'If the User wants to look up a Map for a City or an Area HAL will do so.
'Example:
'User: Please Load Map of the Sacramento Area.
'HAL: Here is the Map of the Sacramento Area. HAL then loads the Map.
'The Prefered Map Search is through Google Maps.
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* MAP ON *", 2)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* MAP FOR THE * AREA", 2)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* MAP FOR *", 2)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* MAP OF THE * AREA", 2)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* MAP OF *", 2)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* MAP", 1)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* MAP", 1)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* DIRECTIONS TO * AREA", 2)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "DIRECTIONS TO * AREA", 1)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* HOW TO GET TO THE * AREA", 2)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* HOW TO GET TO *", 2)
If SearchMaps = "" Then SearchMaps = HalBrain.SearchPattern(OriginalSentence, "* MAP TO * AREA", 1)
If SearchMaps <> "" Then
Mapsearch = "http://www.google.com/local?q=" & SearchMaps
HalMenu.HalCommand "<RUNPROG>" & Mapsearch & "</RUNPROG>"
GetResponse = "Here is a Map of the " & SearchMaps & " Area. "
HalBrain.ReadOnlyMode = True
End If