Hey guys. This is a google search script that might come in handy here and there.
How it works: A person can type in !GSearch "and what they want to search afterwords" and it will bring up a link for them! Example:
[13:20] <~Wariopower> !GSearch How to cook
[13:20] <@WariBot> Link: http://www.google.com/search?q=How%20to%20cook
EDIT: Added flood protection
How to activate it: Take the script and put it in your remote tab and you are good to go!
That's about it for this script. Hope you enjoy.
~ This script was made by Wariopower and BM88 of #WarizardWorks on irc.purplesurge.com ~
on $*:text:$($strip(!GSearch)):#: {
if (!%f) {
inc -u5 %f
.timer 1 1 msg $chan Link: http://www.google.com/search?q= $+ $htmlfrm($2-)
}
}
alias htmlfrm {
var %i = 1,%r
while (%i <= $len($1-)) {
if ($mid($1-,%i,1) isalnum) { %r = %r $+ $ifmatch }
else { %r = %r $+ % $+ $base($asc($mid($1-,%i,1)),10,16,2) }
inc %i
}
return %r
}
alias gsearch {
echo -a Link: http://www.google.com/search?q= $+ $htmlfrm($2-)
}
on $*:text:/[.`!@](GSearch)|(Google) .*/:#:{ if (%g.spam.check [ $+ [ $nick ] ] != 1) { var %x Link: $+(http://www.google.com/search?q=,$replace($2-,$chr(32),+)) | $iif($left($1,1) == @,msg $chan %x,notice $nick %x) | set -u15 %g.spam.check [ $+ [ $Nick ] ] 1 } }
15 second flood protector and theres no need for an alias. Works with `.! and @. Using @ will message the channel, and anything else will notice.