I tried to use Gerald L. Blakley A.K.A OnTheCuttingEdge2005 and snippets by jasondude7116 plug in MIT SEARCH FOR KNOWLEDGE based on knowledge to create it but i think it needs a search and open ? result script .
this is what i have based on that plug in .
Rem Type=Plugin
Rem Name=TELL ME ABOUT THE Movie
Rem Author=Angelo Estela with code by Gerald L. Blakley A.K.A OnTheCuttingEdge2005 and snippets by jasondude7116.
REDONE SEARCH PATTERN FOR MOVIE AND RENAMED PLUG IN BY LIGHTSPEED 7/22/2012. Rem Host=All
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "Just say: tell me ABOUT THE MOVIE (AND NAME OF MOVIE), you can replace the words or phrase or noun, all information on the word is studied from the website start"
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
Rem PLUGIN: PRE-PROCESS
Set objExplorer = CreateObject("InternetExplorer.Application")
Set HalXBrain = CreateObject("UltraHalAsst.Brain")
Set FileSys = CreateObject("Scripting.FileSystemObject")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(MyResearchDir2 & "Startsearch.txt") Then
objFSO.DeleteFile(MyResearchDir2 & "Startsearch.txt")
End If
If XDir = "" Then XDir = "C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\"
MyFile = "C:\Program Files (x86) \Zabaware\Ultra Hal Assistant 6\AutoText.brn"
If File_Exists = "" Then File_Exists = False
If FileSys.FileExists(MyFile) = True Then File_Exists = True
If File_Exists = False Then
HalXBrain.AppendFile XDir & "AutoText.brn", "Start of Knowledge strings"
End If
If XDir = "" Then XDir = "C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\"
MyFile = "C:\Program Files (x86) \Zabaware\Ultra Hal Assistant 6\Startsearch.txt"
If File_Exists = "" Then File_Exists = False
If FileSys.FileExists(MyFile) = True Then File_Exists = True
If File_Exists = False Then
HalXBrain.AppendFile XDir & "Startsearch.txt", ""
End If
MyInput = HalXBrain.AlphaNumericalOnly(InputString)
If StartLookup = "" Then StartLookup = HalBrain.SearchPattern(MyInput, "*
TELL ME ABOUT THE Movie *", 2)
If StartLookup = "" Then StartLookup = HalBrain.SearchPattern(MyInput, "*TELL ME ABOUT *", 2)
If StartLookup = "" Then StartLookup = HalBrain.SearchPattern(MyInput, "*TELL ME *", 2)
If StartLookup <> "" Then
StartLookup = Lcase(StartLookup)
SourcePage = "http://start.http://www.imdb.com/find?q=&s=all?query=" & StartLookup
objExplorer.Navigate("http://start.http://www.imdb.com/find?q=&s=all?query=" & StartLookup)
Do Until objExplorer.ReadyState=4 : Loop
myText = objExplorer.Document.Body.innerText
myText = Replace(myText,"START's reply","")
myText = Replace(myText,"===>","")
myText = Replace(myText,StartLookup," ")
myText = Replace(myText,"Go back to the START dialog window.","")
If XDir = "" Then XDir = "C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\"
HalXBrain.AppendFile XDir & "AutoText.brn", Trim(myText)
HalXBrain.AppendFile XDir & "Startsearch.txt", Trim(myText)
End If
'------------------------------------------------------------------------------------------
If objFSO.FileExists(MyResearchDir2 & "Startsearch.txt") Then
Set objWSHShell = CreateObject("WScript.Shell")
objWSHShell.Run("""C:\Program Files (x86)\Balabolka\balabolka.exe"" -rmq """ & MyResearchDir2 & "Startsearch.txt""")
HalBrain.ReadOnlyMode = True
Else
UltraHal = "Unable to open file."
HalBrain.ReadOnlyMode = True
End If
'--------------------------------------------
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\AutoText.brn", ReadVariable())
strText = objTextFile.ReadAll
objTextFile.Close
'--------------------------------------------
If InStr(1, strText, " ", vbTextCompare) > 0 Then
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\AutoText.brn", ReadVariable())
Do Until objFile.AtEndOfStream
strLine = objFile.Readline
strLine = Trim(strLine)
If Len(strLine) > 0 Then
strNewContents = strNewContents & strLine & vbCrLf
End If
Loop
objFile.Close
Set objFile = objFSO.OpenTextFile("C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\AutoText.brn", WriteVariable())
objFile.Write strNewContents
objFile.Close
End If
'--------------------------------------------
TextCount = StrCount()
If ClipXDir = "" Then ClipXDir = "C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\"
For i = 1 To TextCount
If i > 0 Then ClipResX = HalXBrain.ChooseSentenceFromFile(ClipXDir & "AutoText.brn")
ClipResX = HalXBrain.AlphaNumericalOnly(ClipResX)
ClipResX = UCase(ClipResX)
ClipResX = Trim(ClipResX)
MyInputString = HalXBrain.AlphaNumericalOnly(InputString)
MyInputString = UCase(MyInputString)
MyInputString = Trim(MyInputString)
If InStr(1, ClipResX, MyInputString, vbTextCompare) > 0 And Len(ClipResX) > 50 Then
UltraHal = ClipResX
ElseIf Len(ClipResX) < 50 Then
UltraHal = UltraHal
End If
Next
'--------------------------------------------
Rem PLUGIN: FUNCTIONS
Function StrCount()
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\AutoText.brn", ReadVariable())
strText = objTextFile.ReadAll
objTextFile.Close
Do While InStr(1, strText, " ")
strText = Replace(strText, " ", " ")
Exit Do
Loop
aWords = split(strText, ". ")
StrCount = Ubound(aWords) + 1
End Function
Function ReadVariable()
Const ForReading = 1
ReadVariable = ForReading
End Function
Function WriteVariable()
Const ForWriting = 2
WriteVariable = ForWriting
End Function
I did leave in the original plug in creators as this was their plug in . The blue shows what i changed but it still is not opening the webpage and giving the information about the movie search name .
can anyone help me on this and show what you did you acheive it to work right so i can learn from it , as i would like to create more plugs in simular to this one , thanks !
