• Welcome to Valhalla Legends Archive.
 

[VB6] Google search

Started by Topaz, August 04, 2005, 12:02 PM

Previous topic - Next topic

Topaz

I'm implementing a command in a chatbot which will open the user's browser and send the search query to Google.

I'm not sure why, but this isn't working:

If txtSend.text = Mid("/google", 9) Then
googlesearch = Mid(txtSend.text, 9)
ShellExecuteA Me.hWnd, "Open", "http://www.google.com/search?q=" & googlesearch & "&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official", 0&, 0&, 0&
Exit Sub
End If

I believe its to do with the fact that it's only being read after KeyPress, and at that point txtSend.Text is cleared.

Stealth

Quote from: Topaz on August 04, 2005, 12:02 PM
If txtSend.text = Mid("/google", 9) Then

At first glance, this line is at fault. Your code is somewhat backwards. :)
- Stealth
Author of StealthBot

Topaz

#2
Yeah, I just noticed my error:

If Left(txtSend.Text, 9) = "/google " Then

l)ragon

#3
Quote from: Topaz on August 04, 2005, 12:11 PM
Yeah, I just noticed my error:

If Left(txtSend.Text, 9) = "/google " Then

Shoulden't that be left(text, 8 )

edit: damned smilys
*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*ˆ¨¯¯¨ˆ*^~·.,l)ragon,.-·~^*ˆ¨¯¯¨ˆ*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*

hismajesty


Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?


hismajesty

So, I don't know what that is. I do know, though, that /google was a command I put in PC. :)