with some credits to the people whom wrote the google.uhp plug-in wich I used as example.
Rem Type=Plugin
Rem Name=wolframalpha
Rem Author=Andre Hendriks
Rem Host=Assistant
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "Hal will open your browser and enter a wolframalpha query if you use the keywords 'compute', 'Standard Deviation', 'calculate', or 'bar chart' in a sentence."
lblPlugin(0).Move 120, 120, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
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.
SearchEngine = "
http://www.wolframalpha.com/input/?i="
If InStr(1, UserSentence, "Standard Deviation ", 1) > 0 Or InStr(1, UserSentence, "compute ", 1) > 0 Or InStr(1, UserSentence, "bar chart", 1) > 0 Or InStr(1, UserSentence, "calculate ", 1) > 0 Then
SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), " ", "+"))
SearchKeyWords = Replace(SearchKeywords, "compute+", "")
SearchKeyWords = Replace(SearchKeywords, "bar chart+", "")
SearchKeyWords = Replace(SearchKeywords, "calculate+", "")
SearchKeyWords = Replace(SearchKeywords, "Standard Deviation+", "")
HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
GetResponse = GetResponse & "I will help you research this topic on the Internet. "
End If
an update
Rem Type=Plugin
Rem Name=wolframalpha
Rem Author=Andre Hendriks
Rem Host=Assistant
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "Hal will open your browser and enter a wolframalpha query if you use the keywords 'compute', 'solve', 'formula', 'mean', 'median', 'çommonest element', 'Standard Deviation', 'variance', 'first quartile', 'third quartile', 'interquartile range', 'calculate', 'bar chart', 'histogram', or 'scatter plot' in a sentence."
lblPlugin(0).Move 120, 120, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
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.
SearchEngine = "
http://www.wolframalpha.com/input/?i="
If InStr(1, UserSentence, "Standard Deviation", 1) > 0 Or InStr(1, UserSentence, "solve", 1) > 0 Or InStr(1, UserSentence, "formula", 1) > 0 Or InStr(1, UserSentence, "mean", 1) > 0 Or InStr(1, UserSentence, "median", 1) > 0 Or InStr(1, UserSentence, "commonest element", 1) > 0 Or InStr(1, UserSentence, "variance", 1) > 0 Or InStr(1, UserSentence, "first quartile", 1) > 0 Or InStr(1, UserSentence, "third quartile", 1) > 0 Or InStr(1, UserSentence, "interquartile range", 1) > 0 Or InStr(1, UserSentence, "compute", 1) > 0 Or InStr(1, UserSentence, "bar chart", 1) > 0 Or InStr(1, UserSentence, "histogram", 1) > 0 Or InStr(1, UserSentence, "scatter plot", 1) > 0 Or InStr(1, UserSentence, "calculate", 1) > 0 Then
SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), "", "+"))
SearchKeyWords = Replace(SearchKeywords, "compute+", "")
SearchKeyWords = Replace(SearchKeywords, "solve+", "")
SearchKeyWords = Replace(SearchKeywords, "formula+", "")
SearchKeyWords = Replace(SearchKeywords, "bar chart+", "")
SearchKeyWords = Replace(SearchKeywords, "histogram+", "")
SearchKeyWords = Replace(SearchKeywords, "scatter plot+", "")
SearchKeyWords = Replace(SearchKeywords, "calculate+", "")
SearchKeyWords = Replace(SearchKeywords, "mean+", "")
SearchKeyWords = Replace(SearchKeywords, "median+", "")
SearchKeyWords = Replace(SearchKeywords, "commonest element+", "")
SearchKeyWords = Replace(SearchKeywords, "Standard Deviation+", "")
SearchKeyWords = Replace(SearchKeywords, "variance+", "")
SearchKeyWords = Replace(SearchKeywords, "first quartile+", "")
SearchKeyWords = Replace(SearchKeywords, "third quartile+", "")
SearchKeyWords = Replace(SearchKeywords, "interquartile range+", "")
HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
GetResponse = GetResponse & "I will help you research this topic on the Internet. "
End If
again an update the searchkeyword mean is calculating the general in statistics while it only supposed to calculate the mean I added the general there for.
I noticed that the Mean command needs {dataset} so it gets example: Mean{3 4 6 8 23 56 78 34 54 65}
Rem Type=Plugin
Rem Name=wolframalpha website
Rem Author=Andre Hendriks
Rem Host=Assistant
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "Hal will open your browser and enter a wolframalpha query if you use the keywords 'Compute', 'Solve', 'Formula', 'General', 'Mean', 'Median', 'Commonest Element', 'Standard Deviation', 'Variance', 'First Quartile', 'Third Quartile', 'Interquartile Range', 'Calculate', 'Bar Chart', 'Histogram', or 'Scatter Plot' in a sentence."
lblPlugin(0).Move 120, 120, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
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.
SearchEngine = "
http://www.wolframalpha.com/input/?i="
If InStr(1, UserSentence, "Standard Deviation", 1) > 0 Or InStr(1, UserSentence, "General", 1) > 0 Or InStr(1, UserSentence, "Solve", 1) > 0 Or InStr(1, UserSentence, "Formula", 1) > 0 Or InStr(1, UserSentence, "Mean", 1) > 0 Or InStr(1, UserSentence, "Median", 1) > 0 Or InStr(1, UserSentence, "Commonest Element", 1) > 0 Or InStr(1, UserSentence, "Variance", 1) > 0 Or InStr(1, UserSentence, "First Quartile", 1) > 0 Or InStr(1, UserSentence, "Third Quartile", 1) > 0 Or InStr(1, UserSentence, "Interquartile Range", 1) > 0 Or InStr(1, UserSentence, "Compute", 1) > 0 Or InStr(1, UserSentence, "Bar Chart", 1) > 0 Or InStr(1, UserSentence, "Histogram", 1) > 0 Or InStr(1, UserSentence, "Scatter Plot", 1) > 0 Or InStr(1, UserSentence, "Calculate", 1) > 0 Then
SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), "", "+"))
SearchKeyWords = Replace(SearchKeywords, "Compute+", "")
SearchKeyWords = Replace(SearchKeywords, "Solve+", "")
SearchKeyWords = Replace(SearchKeywords, "Formula+", "")
SearchKeyWords = Replace(SearchKeywords, "Bar Chart+", "")
SearchKeyWords = Replace(SearchKeywords, "Histogram+", "")
SearchKeyWords = Replace(SearchKeywords, "Scatter Plot+", "")
SearchKeyWords = Replace(SearchKeywords, "Calculate+", "")
SearchKeyWords = Replace(SearchKeywords, "General+", "")
SearchKeyWords = Replace(SearchKeywords, "Mean+", "")
SearchKeyWords = Replace(SearchKeywords, "Median+", "")
SearchKeyWords = Replace(SearchKeywords, "Commonest Element+", "")
SearchKeyWords = Replace(SearchKeywords, "Standard Deviation+", "")
SearchKeyWords = Replace(SearchKeywords, "Variance+", "")
SearchKeyWords = Replace(SearchKeywords, "First Quartile+", "")
SearchKeyWords = Replace(SearchKeywords, "Third Quartile+", "")
SearchKeyWords = Replace(SearchKeywords, "Interquartile Range+", "")
HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
GetResponse = GetResponse & "I will help you research this topic on the Internet. "
End If