(http://img440.imageshack.us/img440/5233/zdgb114wj.gif)
v1.1 can be downloaded from:
mirror 1 (http://ptxscriptdb.psycho-chihuahua.net/download.php?view.105)
mirror 2 (http://www.ihud.com/files/1129141508/Google.Bot.v.1.1.LUA5-ZD.rar)
mirror 3 (http://www.rapidsharing.com/out.php/i2723_Google.Bot.v.1.1.LUA5-ZD.rar)
mirror 4 (http://uploadx.net/file/?id=rtjzlq8=)
v1.0 can still be downloaded from here (http://ptxscriptdb.psycho-chihuahua.net/download.php?view.98).
*Note: changelog.txt doesn't have an entry for the change I made to the script which will tell the user if his search didn't return any results.
To-add features:
?- [v1.2] !google command (would use a default amount of results to send back to the user)
?- [v1.2] Option to return the result's description along with the result instead of just title+url.
?- [v1.2] Top Searches feature (Got the idea from Dessamator's "SearchCount" script.)
Feel free to post any bugs or feature requests. Also, if you use this script, I'd definately like to know where you're using it. Feel free to send me a PM telling me which hub it's being used in.
Haven't tested script yet but idea is good usage of bluebear's pxwsa library. Congrulations...
But.. Have a question: Isn't it better to encourage users to use "/g" command in DC++ and consume their own bandwitdh instead of using your script and consuming server's bandwidth?
[11:39] Syntax ...14-9\backup14-9\scripts\Google.Bot.v.1.0.LUA5-ZD.lua:31: attempt to call global `libinit' (a nil value)
this wht i get when run google script... :rolleyes:
QuoteOriginally posted by digi
[11:39] Syntax ...14-9\backup14-9\scripts\Google.Bot.v.1.0.LUA5-ZD.lua:31: attempt to call global `libinit' (a nil value)
this wht i get when run google script... :rolleyes:
Make sure pxwsa.dll is located in your ptokax directory (the backup14-9 folder in your case)
QuoteOriginally posted by GeceBekcisi
Haven't tested script yet but idea is good usage of bluebear's pxwsa library. Congrulations...
But.. Have a question: Isn't it better to encourage users to use "/g" command in DC++ and consume their own bandwitdh instead of using your script and consuming server's bandwidth?
Indeed.
QuoteOriginally posted by GeceBekcisi
But.. Have a question: Isn't it better to encourage users to use "/g" command in DC++ and consume their own bandwitdh instead of using your script and consuming server's bandwidth?
Yes, it would probably be better for the users to just do it that way. Although, if your server has the spare bandwidth, I don't really see any problem against the use of this bot. It might actually be easier to use this bot in one small sense:
Example of user searching google with the /g cmd:
User types in: /g keywords
Window pops up, takes user to google page.
User chooses the url he wishes to go to.
Example of user searching with the bot:
User types in !google (or !g if you want it short as possible) # keywords
User chooses the url he wishes to go to from the hub (no need for the user to go to google.)
But, either way, it's up to the hub owner's choice weither or not they want to run this script ;P
QuoteOriginally posted by Mutor
Maybe a few too many globals as well.
This is my first script ;P. Any suggestions are welcomed to improve it.
QuoteOriginally posted by Mutor
Still a fine effort and good example of using the socket library.
Keep up the good work [ZD][Psycho]
Thanks. I plan to make more scripts that make use of pxwsa.
i have translated the script into German :]
@[ZD][Psycho] its a great script
your google script not work don't know y
but if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D
QuoteOriginally posted by (-=TrIp-iN-SuN=-)
your google script not work don't know y
but if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D
Now you are a moron. first you insult me in PM, are unable to understand that I will a release right after new PxWSA is released (since I cannot debug it as well with this one), then you start to ask every day like if I was the PxWSA developer but I got no exact bug reports from you either in PM or main.
P. S.: apologies for polluting your thread, [ZD][Psycho]. :(
QuoteOriginally posted by (-=TrIp-iN-SuN=-)
your google script not work don't know y
No errors? Are you doing the commands right?
Quotebut if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D
I have no intentions on starting such a project when there is already such a project being worked on ;P.
QuoteOriginally posted by bastya_elvtars
P. S.: apologies for polluting your thread, [ZD][Psycho]. :(
Don't worry about it ;P
QuoteOriginally posted by (-=TrIp-iN-SuN=-)
your google script not work don't know y
but if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D
hmm funny, works fine here
[00:57:59] *** Server command: !google 5 lua forum
[00:58:00] *** Psycho_Chihuahua is googling for "lua forum". Type in !google 5 lua forum to search for the same.
[00:58:00] ****** The LUA Language Board - Main Page ---> [URL]http://board.univ-angers.fr/main.php[/URL]
[00:58:00] ****** DCEmu Forums The Worlds Best Dreamcast, PSP, Nintendo DS, Xbox 360 ... ---> [URL]http://www.dcemu.co.uk/vbulletin/forumdisplay.php?f=89[/URL]
[00:58:00] ****** DCEmu Forums The Worlds Best Dreamcast, PSP, Nintendo DS, Xbox 360 ... ---> [URL]http://www.dcemu.co.uk/vbulletin/archive/index.php/f-89.html[/URL]
[00:58:00] ****** The Ptokax LUA Language Board
[00:58:00] Main Page ---> [URL]http://lua.uknnet.com/[/URL]
[00:58:00] ****** Curse Gaming Forums - Checking if a player is online via lua? ---> [URL]http://forums.curse-gaming.com/archive/index.php/t-2319.html[/URL]
QuoteOriginally posted by [ZD][Psycho]
Quotebut if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D
I have no intentions on starting such a project when there is already such a project being worked on ;P.
If you can look at it, feel free to edit, since all I did was plain conversion.
QuoteOriginally posted by (-=TrIp-iN-SuN=-)
your google script not work don't know y
but if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D
r u sure that u instaled pxwsa.dll?
shoutstats and google bot works just fine for me too, EXELENT work guys!
Thx a lot 4 that :P
QuoteOriginally posted by (-=TrIp-iN-SuN=-)
your google script not work don't know y
but if u can make a script shoutstats many peolpe need this and this script what released it's doing so mach problams :D
I was thinking of that this is a special conflict. I remember having problems like this with Kerio, what firewall/antivirus/antispyware/other are you using?
hi
lovley script this one 8)
can you make so it when commands runs it comes in PM insteed of MAIN or a option so that you can choose
one more thing
can you delete so when a user uses the google bot it will not notify in main that this user search for bla bla
hope you understand me :rolleyes:
cheers
QuoteOriginally posted by GrinSlaW
hi
lovley script this one 8)
can you make so it when commands runs it comes in PM insteed of MAIN or a option so that you can choose
one more thing
can you delete so when a user uses the google bot it will not notify in main that this user search for bla bla
hope you understand me :rolleyes:
cheers
I'll add options in the next version to do both of them, however I won't be able to do any work to the script any time soon (I've been pretty busy lately.)
Google.Bot.v.1.1.LUA5-ZD has been released. First post edited with the details.
1 Question what is the rightklick command for the Google.Bot.v.1.0.LUA5-ZD
the other 1 don't work good >> Google.Bot.v.1.1.LUA5-ZD
QuoteOriginally posted by vadertje
1 Question what is the rightklick command for the Google.Bot.v.1.0.LUA5-ZD
I didn't include any rightclick commands in Google.Bot.v.1.0.LUA5-ZD. I added the rightclicks in v1.1.
Quotethe other 1 don't work good >> Google.Bot.v.1.1.LUA5-ZD
What's wrong with it? Do you mean the command called "Google.Bot.v1.1 by ZD Scripting Team." doesn't do anything? I just added that as more of an advertisement or something :P
wen i use the scipt and i restart scipts he disconect the users and i mus restart the hub again :S and wen i restart hub he giove a failre :S about the hub addy :S
1.0 works good but 1.1 not :(
QuoteOriginally posted by vadertje
wen i use the scipt and i restart scipts he disconect the users and i mus restart the hub again :S and wen i restart hub he giove a failre :S about the hub addy :S
1.0 works good but 1.1 not :(
Try removing this at the very end of the v1.1 script:
function OnExit()
WSA.Dispose()
end
yea my script 1.1 and 1.0 dosen't work too :/ I do all this thinks but is still nothing ;/ why ??
it's verison 1.0 in Google.Bot.v.1.0.LUA5-ZD.lua and i have install pxwsa.dll in Central Folder PtokaX, Why didn't work ?? i use command !google and text, its not working :/
gCMD="!google" -- Command to use to google on google. No spaces! It should have a prefix infront of it, e.g. ! or +
gMAX="5" -- Maximum amount of searches that can be returned to the user. Google can only return 100 results, although I highly wouldn't recommend going over 15 results.
Host="www.google.com" -- No need to edit this, unless google changes their domain ;P
libinit = loadlib("pxwsa.dll", "_libinit")
libinit()
function ChatArrival(user, data)
data = string.sub(data,1,string.len(data)-1)
_,_,cmd,num,qry = string.find(data, "%b<>%s("..gCMD..")%s(%d+)%s(.+)")
if cmd == gCMD and num <= gMAX then
s,e,usr=string.find(data, "<(%S+)>")
SendToAll("*** "..usr.." is googling for \""..qry.."\". Type in "..gCMD.." "..num.." "..qry.." to search for the same.")
gConvert()
SrcPg=("/search?q="..qry.."&num="..num)
NewSck()
return 1
elseif cmd == gCMD and num > gMAX then
user:SendData("*** You may not use a higher number than "..gMAX..".")
return 1
end
end
function gConvert()
qry=string.gsub(qry, "%%", "%%25")
qry=string.gsub(qry, " ", "+")
qry=string.gsub(qry, "%*", "%%2A")
qry=string.gsub(qry, "%+", "%%2B")
qry=string.gsub(qry, ",", "%%2C")
qry=string.gsub(qry, "%-", "%%2D")
qry=string.gsub(qry, "/", "%%2F")
qry=string.gsub(qry, "%.", "%%2E")
qry=string.gsub(qry, ":", "%%3A")
qry=string.gsub(qry, ";", "%%3B")
qry=string.gsub(qry, "<", "%%3C")
qry=string.gsub(qry, "=", "%%3D")
qry=string.gsub(qry, ">", "%%3E")
qry=string.gsub(qry, "%?", "%%3F")
qry=string.gsub(qry, "%[", "%%5B")
qry=string.gsub(qry, "\\", "%%5C")
qry=string.gsub(qry, "%]", "%%5D")
qry=string.gsub(qry, "%^", "%%5E")
qry=string.gsub(qry, "_", "%%5F")
qry=string.gsub(qry, "{", "%%7B")
qry=string.gsub(qry, "|", "%%7C")
qry=string.gsub(qry, "}", "%%7D")
qry=string.gsub(qry, "~", "%%7E")
qry=string.gsub(qry, "!", "%%21")
qry=string.gsub(qry, "#", "%%23")
qry=string.gsub(qry, "&", "%%26")
qry=string.gsub(qry, "'", "%%27")
qry=string.gsub(qry, "%(", "%%28")
qry=string.gsub(qry, "%)", "%%29")
qry=string.gsub(qry, "@", "%%64")
qry=string.gsub(qry, "`", "%%60")
end
function OnWsaConnected(errorCode,errorStr,sock)
if errorCode then
WSA.Close(sock)
SendToNick(usr, "*** Failed to connect to "..Host..".")
else
local CMD="GET "..SrcPg.." HTTP/1.0\r\nHost: "..Host.."\r\nUser-Agent: Mozilla/4.0\r\n"..string.char(13,10)
WSA.BeginSend(sock,CMD)
end
end
function OnWsaSendComplete(errorCode,errorStr,sock,bytesSent)
if errorCode then
WSA.Close(sock)
SendToNick(usr, "*** Failed to send data to "..Host..".")
else
WSA.BeginReceive(sock)
end
end
function OnWsaDataArrival(errorCode,errorStr,sock,sdata,bytesRead)
if not errorCode or (errorCode==10040 and prot==0) then
DataRecv=DataRecv..sdata
return 1
else
DataRecv=string.gsub(DataRecv, "", "")
DataRecv=string.gsub(DataRecv, "", "")
DataRecv=string.gsub(DataRecv, "
", "")
DataRecv=string.gsub(DataRecv, "'", "'")
DataRecv=string.gsub(DataRecv, ">", ">")
DataRecv=string.gsub(DataRecv, "", "
")
DataRecv=string.gsub(DataRecv, "/url?sa=U&start=%d&q=", "")
DataRecv=string.gsub(DataRecv, "", ">")
for url,name in string.gfind(DataRecv, "]*)>([^<]*)") do
SendToNick(usr, "****** "..(name or "failed").." ---> "..(url or "failed"))
end
DataRecv=""
return 0
end
end
function NewSck()
_,_,sock=WSA.NewSocket(0)
WSA.BeginConnect(sock,Host,80)
end
DataRecv=""
QuoteOriginally posted by Gx_lucas
yea my script 1.1 and 1.0 dosen't work too :/ I do all this thinks but is still nothing ;/ why ??
it's verison 1.0 in Google.Bot.v.1.0.LUA5-ZD.lua and i have install pxwsa.dll in Central Folder PtokaX, Why didn't work ?? i use command !google and text, its not working :/
Is the script producing any errors? Check the "scripts" tab in your PtokaX GUI.
no is not ;/ but dosen't work ;/
QuoteOriginally posted by Gx_lucas
no is not ;/ but dosen't work ;/
The only thing I can think of is you are using an older version of PtokaX. You must have PtokaX 0.3.3.21 or later.
I have a similar problem with the script not working, but it's even more maddening because it DID work for a day and me and some hubbies used it. Then it stopped working and I've tried everything in the book to get it working again, without success. Tried re-arranging the script order, deleting the settings file and let the script re-create it and whatnot. Using Ptokax 0.3.4.0, standard ptokax profiles.
The error I am getting is this:
Syntax ...nternet\ptokax\scripts\Google.Bot.v.2.01.LUA5-ZD.lua:122: attempt to call field `BeginConnect' (a nil value)
Variables:
gAPF={ -- This set of variables is a table instead of a typical string like the variables above. It allows you to disallow users in specific profiles to use the bot. Note that the current profiles are setup for robocop's profile hierarchy. (options: 1 = allow, 0 = disallow.)
[0]=1, -- Profile #0 (Registered)
[1]=1, -- Profile #1 (VIP)
[2]=1, -- Profile #2 (Operator)
[3]=1, -- Profile #3 (Moderator)
[4]=1, -- Profile #4 (Master)
[5]=1, -- Profile #5 (Netfounder)
[-1]=0, -- Profile #-1 (Unregistered)(I recommend that unregistered users are disallowed from using the bot.)
}
gSET={ -- This table lets you specify who is allowed to change the bot's settings. Be very careful who you allow. (Options: 1 = allow, 0 = disallow)
[0]=0, -- Profile #0 (Registered)
[1]=0, -- Profile #1 (VIP)
[2]=0, -- Profile #2 (Operator)
[3]=0, -- Profile #3 (Moderator)
[4]=1, -- Profile #4 (Master)
[5]=1, -- Profile #5 (Netfounder)
[-1]=0, -- Profile #-1 (Unregistered)(I recommend that unregistered users are disallowed from using the bot.)
}
I've quadruple-checked the locations of required files. Any ideas?
same goes for the 2.02 version
my guess is that something has changed with the new pxwsa
my error is the same just in line 107 ^^
some on can convert it to lua 5.1 ? "Google.Bot.v.1.0.LUA5-ZD"
;)
tnx