Zabaware Support Forums

WordNet with Images - New For Hal 6

Started by mikmoth, February 19, 2005, 10:22:30 PM

Previous topic - Next topic

mikmoth

#15
I rewrote the whole thing from scratch Spydaz! Look at the first post. I am also including the Perl script! Have fun!
 

seduar

Hi Mikmoth,

I am trying to paste the script to bring pictures and i have a question,
I do not know much about scripting but i am intereted in what you did, it sounds cool.
What is 755 and how do i change it?.

can you explain a little bit more about cahanging permition to 755?.
 

mikmoth

#17
Sorry if I didn't make it clear.

All most people need to do is copy/paste the text you see in the message into your brain. That's it.

If you are a more advanced user and you want to host the Perl script on your own server then you would download the attached script, upload it to your cgi-bin, and set the permissions of it to 755.

If you just want to get it working... copy this into your brain under the Wordnet Dictionary Function. Then load up Hal and type "Show me an airplane." or "Show me a deer." or whatever.

'RESPOND: LOOK UP IMAGE
If InStr(1, UserSentence, "SHOW YOU ", 1) > 0  Then
lookup = Replace(UserSentence, "SHOW YOU ", "", 1, -1, vbTextCompare)
If InStr(1,lookup,".", 1) > 0 Then lookup = Replace(lookup,".","",1,-1, vbTextCompare)
If InStr(1,lookup," A ", 1) > 0 Then lookup = Replace(lookup," A ","",1,-1, vbTextCompare)
If InStr(1,lookup," AN ", 1) > 0 Then lookup = Replace(lookup," AN ","",1,-1, vbTextCompare)
If WN.LookUpWord(lookup) = False Then
GetResponse = "I have no definition but I will try to find an image."
End If
If WN.LookupWord(lookup) = True Then
GetResponse = GetResponse & lookup & ": " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "D") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "S") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "E") & "." & vbCrLf & "<EXCLUSIVE>"
End If
Set IE = CreateObject("InternetExplorer.Application")
cdc = "http://www.karigirl.com/cgi-bin/popup.pl?term=" + lookup + "&secs=5" 'Secs until window closes. 0=never
IE.Navigate cdc
IE.AddressBar = False
IE.menubar = False
IE.ToolBar = False
IE.StatusBar = False
IE.width = 450
IE.height = 450
IE.resizable = False
IE.visible = True
End If



 

seduar

Thank you Mikmoth,

I Like this pluggin, but the window with the picture pops up behind hal, is there any way thgat the picture pops up infront and not on the back?
 

spydaz

quote:
Originally posted by mikmoth

Sorry if I didn't make it clear.

All most people need to do is copy/paste the text you see in the message into your brain. That's it.

If you are a more advanced user and you want to host the Perl script on your own server then you would download the attached script, upload it to your cgi-bin, and set the permissions of it to 755.

If you just want to get it working... copy this into your brain under the Wordnet Dictionary Function. Then load up Hal and type "Show me an airplane." or "Show me a deer." or whatever.

'RESPOND: LOOK UP IMAGE
If InStr(1, UserSentence, "SHOW YOU ", 1) > 0  Then
lookup = Replace(UserSentence, "SHOW YOU ", "", 1, -1, vbTextCompare)
If InStr(1,lookup,".", 1) > 0 Then lookup = Replace(lookup,".","",1,-1, vbTextCompare)
If InStr(1,lookup," A ", 1) > 0 Then lookup = Replace(lookup," A ","",1,-1, vbTextCompare)
If InStr(1,lookup," AN ", 1) > 0 Then lookup = Replace(lookup," AN ","",1,-1, vbTextCompare)
If WN.LookUpWord(lookup) = False Then
GetResponse = "I have no definition but I will try to find an image."
End If
If WN.LookupWord(lookup) = True Then
GetResponse = GetResponse & lookup & ": " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "D") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "S") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "E") & "." & vbCrLf & "<EXCLUSIVE>"
End If
Set IE = CreateObject("InternetExplorer.Application")
cdc = "http://www.karigirl.com/cgi-bin/popup.pl?term=" + lookup + "&secs=5" 'Secs until window closes. 0=never
IE.Navigate cdc
IE.AddressBar = False
IE.menubar = False
IE.ToolBar = False
IE.StatusBar = False
IE.width = 450
IE.height = 450
IE.resizable = False
IE.visible = True
End If







http://images.google.com/images?q=mum <<<<<<<<<<<<<<  cdc

mikmoth

#20
That's how I had mine in the first place spydaz... but I dunno, I like just getting one big image myself. Oh... and you have to keep closing the window manually. Kinda lame...