sockread %tmp
if $regex(results,%tmp,/<p>No results were found for the <b>exact</b> search <b>(.*)</b/) {
%clan.style. [ $+ [ %x ] ] 12 [ $+ $col1(Clan) $+ $col2(]: %clan.name. [ $+ [ %x ] ]) $col1(is not in any clans on)
$col2(RuneHead)
sockclose $sockname
halt
}
}
if $regex(clan,%tmp,/<td style='width:90px; border-color:#404040;'><a href='(.*)'>(.*)</a></td>/) {
%clan.style. [ $+ [ %x ] ] 12 [ $+ $col1(Clan) $+ $col2(]: %clan.name. [ $+ [ %x ] ]) $col1(is in clan:)
$col2($regml(clan,2)) }
if </html> iswm %tmp {
sockclose $sockname
}
}
}
on *:SOCKCLOSE:clan.*:{
unset %clan.*
halt
}
on *:text:!mimic-on:#:{
/set %copytrigger ON | notice $nick Mimicing has been turned 'ON.'
}
on *:text:!mimic *:#:{
if (%copytrigger != ON) { notice $nick Please type !mimic-on first. | halt }
set %copynick $2- | notice $nick Now Mimicing: %copynick $+ . }
}
on *:text:*:#:{
if ($1 == !mimic-off) { unset %copynick | set %copytrigger OFF | notice $nick Mimicing Has Been Turned 'OFF.' } else {
if (%copytrigger != ON) { halt } else {
if ($nick == %copynick) msg $chan $1-
}
}
}
on *:text:!pcw-on:#:{
if (($nick isop $chan) || ($nick isop $chan) || ($nick == [Gangsta05na])) {
set %pcIO ON
;SET COLOR HERE FOR TEXT OTHER THEN WORLD
set %pcwtextcol 12
;SET COLOR HERE FOR TEXT OF WORLD AND WHO IT WAS SET BY
set %pcwcol 4
;SET COLOR HERE FOR ERROR MESSAGES
set %pcerrcol 7
notice $nick %pcwtextcol $+ PCW Script is now Online.
else {
notice $nick %pcwtextcol $+ You must be a Half-Op or Operator to turn this script on.
}
}
}
on $*:text:/^!(pcw|pc|world|pcworld)(?= |$)/iS:#:{
if (%pcIO != ON) { halt }
if (%pcworld == $null) { notice $nick %pcwtextcol $+ There is no PC World set. | halt }
notice $nick %pcwtextcol $+ The current PC World is $+ %pcwcol %pcworld $+ . %pcwtextcol $+ Last set by %pcwcol $+
%setpcwnick $+ .
}
on $*:text:/^!(pcchange|change|setpcw|setpcworld|changepcw|changepc) ./iS:#:{
if (%pcIO != ON) { notice $nick %pcerrcol $+ The PCW Script is currently Offline. | halt }
if (($2 > 132) || ($2 < 1)) { notice $nick %pcerrcol $+ Please choose a valid RS World. (1 - 132) | halt }
set %setpcwnick $nick
set %pcworld $2-
msg #testchan %pcwtextcol $+ The PCW has been updated! Type !pcw to view it.
}
on *:text:!pcw-off:#:{
if (($nick ishop $chan) || ($nick isop $chan) || ($nick == [Gangsta05na])) {
notice $nick %pcwtextcol $+ PCW Script is now Offline.
unset %pcIO
unset %pcworld
unset %setpcwnick
else {
notice $nick %pcwtextcol $+ You must be atleast a Half-Op or Operator to turn this script off.
}
}
}
on *:TEXT:?google *:*: {
;COLOR SETTING:
set %col 12
inc %ID 1
set $+(%,search.,%ID) $replace($2-,$chr(32),+) $iif($chan,$iif($left($1,1) == !,notice $nick,msg $chan),msg $nick)
sockopen $+(google.,%ID) www.google.com 80
}
on *:SOCKOPEN:google.*: {
sockwrite -nt $sockname GET /search?hl=en&q= $+ $gettok($($+(%,search.,%ID),2),1,32) $+ &btnI HTTP/1.1
sockwrite -nt $sockname Host: www.google.com
sockwrite -t $sockname $str($crlf,2)
}
on *:SOCKREAD:google.*: {
var %IDt = $right($sockname,-7)
var %target = $gettok($($+(%,search.,%IDt),2),2-,32)
if ($sockerr) {
%target $chr(91) $col(ERROR) $chr(93) Socket error
unset %search. $+ $right($sockname,-7)
sockclose $sockname
}
else {
var %read | sockread %read
if (Location:* iswm %read) {
%target $chr(91) $col(GOOGLE) $chr(93) $remove($htmlfree(%read),Location:)
unset %search. $+ $right($sockname,-7)
sockclose $sockname
}
if (*did not match any documents* iswm %read) {
%target $chr(91) $col(GOOGLE) $chr(93) No results found
unset %search. $+ $right($sockname,-7)
sockclose $sockname
}
}
/close -m $nick
}
alias -l col { return $+($chr(3),$iif($len(%col) == 2,%col,$+(0,%col)), $1-, $chr(3)) }
alias -l htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
ON 1:TEXT:!kick*:#: { if (($nick ishop $chan) || ($nick isop $chan)) { /kick $chan $2 $3- } }
ON 1:TEXT:!kb*:#: { if (($nick ishop $chan) || ($nick isop $chan)) { /cs ban $chan $iif($2,$2,$nick) } { /cs kick $chan
$iif($2,$2,$nick) } }
ON 1:TEXT:!ban*:#: { if (($nick ishop $chan) || ($nick isop $chan)) { /mode $chan +b $iif($2,$2,$nick) } }
ON 1:TEXT:!unban*:#: { if (($nick ishop $chan) || ($nick isop $chan)) { /mode # -b $iif($2,$2,$nick) } }
ON 1:TEXT:!voice*:#: { if (($nick ishop $chan) || ($nick isop $chan)) { /mode $chan +v $2 } }
ON 1:TEXT:!devoice*:#: { if (($nick ishop $chan) || ($nick isop $chan)) { /mode $chan -v $2 } }
ON 1:TEXT:!halfop*:#: { if (($nick ishop $chan) || ($nick isop $chan)) { /mode $chan +h $2 } }
ON 1:TEXT:!dehalfop*:#: { if (($nick ishop $chan) || ($nick isop $chan)) { /mode $chan -h $2 } }
ON 1:TEXT:!op*:#: { if (($nick ishop $chan) || ($nick isop $chan)) { /mode $chan +o $2 } }
ON 1:TEXT:!deop*:#: { if (($nick ishop $chan) || ($nick isop $chan)) { /mode $chan -o $2 } }