;,$Calc($BFind(&news,1,$GetTok(%news,2,59))
+ 5)),),,;)
IF (%news) %newsoutput = %newsoutput $Sep $+([,%i,]:) $+(",$c2($GetTok(%news,2,59)),") on $c2($GetTok(%news,1,59))
INC %i
}
%target %newsoutput
}
}
ELSE $($+(%,target.,$SockName),2) Unable to retrieve data from runescape.com!
CleanUp $SockName
}
on *:text:*define *:*: {
;COLOR SETTING:
set %col 09
inc %ID 1
set $+(%,search.,%ID) $replace($2-,$chr(32),+) $iif($chan,$iif($left($1,1) == !,notice $nick,msg $chan),msg $nick)
sockopen $+(def.,%ID) wordnet.princeton.edu 80
}
on *:SOCKOPEN:def.*: {
sockwrite -nt $sockname GET /perl/webwn?s= $+ $gettok($($+(%,search.,%ID),2),1,32) HTTP/1.1
sockwrite -nt $sockname Accept-Language: en-us
sockwrite -nt $sockname Host: wordnet.princeton.edu
sockwrite -t $sockname $str($crlf,2)
}
on *:SOCKREAD:def.*: {
var %IDt = $right($sockname,-4)
var %target = $gettok($($+(%,search.,%IDt),2),2-,32)
if ($sockerr) {
%target $chr(91) $col(ERROR) $chr(93) Socket error
sockclose $sockname
}
else {
:nextread
var %read | sockread %read
if (Your search did not return any results. isin $htmlfree(%read)) {
%target $chr(91) $col(DEFINE) $chr(93) No results found
unset %search. $+ $right($sockname,-4)
sockclose $sockname
}
elseif (S: isin $htmlfree(%read)) {
if (SEARCH DISPLAY OPTION == $remove($htmlfree(%read),S:,)) { goto nextread }
if (KEY isincs $remove($htmlfree(%read),S:,)) { goto nextread }
if ($($+(%,reads.,%IDt),2) == $null) { set $+(%,reads.,%IDt) 1 }
if ($($+(%,reads.,%IDt),2) < 3) {
%target $chr(91) $col(DEFINE) $chr(93) $remove($htmlfree(%read),S:,)
inc $+(%,reads.,%IDt) 1
goto nextread
}
close -m $nick
unset %search. $+ $right($sockname,-4) | unset %reads. $+ $right($sockname,-4)
sockclose $sockname
}
}
}
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 *:TEXT:!rsplayers:#: {
if ($sock(RSplay)) {
.sockclose RSplay
}
sockopen RSplay runescape.com 80
set %chan $chan
}
on *:SOCKOPEN:RSplay: {
sockwrite -n $sockname GET /lang/en/aff/runescape/title.ws
sockwrite -n $sockname Host: runescape.com
sockwrite $sockname $crlf
}
on *:SOCKREAD:RSplay: {
if ($sockerr) {
msg %chan There was an error while the socket was being read. ( $+ $sockerr $+ )
halt
}
else {
var %sockreader
sockread %sockreader
tokenize 32 $nohtml(%sockreader)
if (There are currently * people playing!* iswm $1-) {
msg %chan 7There are currently $4 people playing RuneScape.
unset %chan
sockclose RSplay
}
}
}
alias nohtml { var %x,%y = $regsub($1-,/(<[^>]+>)/g,$null,%x) | return %x }
| return %x }
on $*:TEXT:/^[!@]price */Si:#: {
inc %zybez.use
if (%zybez.use >= 3) {
$iif($left($1,1) == @,msg $chan,notice $nick) Price Guide made possibly by Zybez's Price Guide: http://zybez.com
.unset %zybez.use
}
var %rstr = $+($r(0,9),$r(0,9),$r(0,9),$r(0,9),$r(0,9))
.set %price. $+ $(%rstr,2) $+ .rn $numtok($2-,44)
.set %price. $+ $(%rstr,2) $+ .rc 1
.set %price. $+ $(%rstr,2) $+ .rvmi 0
.set %price. $+ $(%rstr,2) $+ .rvma 0
.set %price. $+ $(%rstr,2) $+ .nick $nick
.set %price. $+ $(%rstr,2) $+ .type $iif($2 == -e,strict,$iif(-s* iswm $2,spend $dcon($remove($2,-s)),free))
.set %price. $+ $(%rstr,2) $+ .item $iif($2 == -e || -s* iswm $2,$3-,$2-)
.set %price. $+ $(%rstr,2) $+ .ret $iif($left($1,1) == ?,msg $chan,notice $nick)
.sockopen price. $+ $(%rstr,2) zybez.com 80
}
alias mcol { return $+($chr(3),02,$1,$chr(3),) }
alias pcol { return $+($chr(3),07,$1,$chr(3),) }
alias icol { return $+($chr(3),04,$1,$chr(3),) }
alias dcon {
if (*.* !iswm $1) {
return $replace($1-,K,000,M,000000,B,000000000)
}
if (*.* iswm $1) && (($right($1,1) == K) || ($right($1,1) == M) || ($right($1,1) == B)) {
var %rdat = $1, %nums = $len($gettok($remove($1,K,M),2,46))
%rdat = $calc($remove($1,.,K,M,B) * $iif($right($1,1) == K,$+(1,$str(0,$calc(3 - %nums))),$iif($right($1,1) ==
M,$+(1,$str(0,$calc(6 - %nums))),$+(1,$str(0,$calc(9 - %nums))))))
return %rdat
}
else {
return $1
}
}
on *:SOCKOPEN:price.*: {
if ($sockerr) {
$($+(%,price.,$right($sockname,5),.ret),2) SockOpen Error: $sock($sockname).wsmsg
return
}
var %rid = $right($sockname,5)
.unset $($+(%,price.calc.,%rid),1)
tokenize 32 $gettok($($+(%,price.,%rid,.item),2),$($+(%,price.,%rid,.rc),2),44)
if ($remove($1,k,m,.) !isnum) { var %price.tmp.sendname = $replace($1-,$chr(32),+) }
else { var %price.tmp.sendname = $replace($remove($2-,$1),$chr(32),+) | .set %price.calc. $+ %rid $dcon($1) }
;if ($right(%price.tmp.sendname,1) == s) { %price.tmp.sendname = $left(%price.tmp.sendname,-1) }
.sockwrite -n $sockname GET /priceguide.php?search_terms= $+ %price.tmp.sendname $+
&search_area=1&price_low=&price_high=&member=1 HTTP/1.1
.sockwrite -n $sockname Host: zybez.com $+ $crlf $+ $crlf
}
on *:SOCKREAD:price.*: {
if ($sockerr) {
$($+(%,price.,$right($sockname,5),.ret),2) SockRead Error: $sock($sockname).wsmsg
return
}
var %rid = $right($sockname,5)
tokenize 32 $gettok($($+(%,price.,%rid,.item),2),$($+(%,price.,%rid,.rc),2),44)
if ($remove($1,k,m,.) !isnum) { var %price.tmp.sendname = $replace($1-,$chr(32),+) }
else { var %price.tmp.sendname = $replace($2-,$chr(32),+) | .set %price.calc. $+ %rid $dcon($1) }
.sockread %sr
if (** iswm %sr) && (** !iswm %sr) && (**
!iswm %sr) { halt }
if (** iswm %sr) { .unset %price.read. $+ %rid }
if ($($+(%,price.read.,%rid),2) != $null) && (%sr != $null) {
if (*search did not return any* iswm %sr) {
.set %price. $+ %rid $+ .rs $($+(%,price.,%rid,.rs),2) $+ , $pcol(No price found for)
$icol($gettok($($+(%,price.,%rid,.item),2),$($+(%,price.,%rid,.rc),2),44)))
if ($($+(%,price.,%rid,.rc),2) < $($+(%,price.,%rid,.rn),2)) {
.next_price %rid
halt
}
}
else {
if ($($+(%,price.read.,%rid),2) == 4) {
if ($+(*,$($+(%,price.tmp.name.,%rid),2),*) !iswm $($+(%,price.,%rid,.rs),2)) {
if ($gettok($($+(%,price.,%rid,.type),2),1,32) == spend) {
.set %price.calc. $+ %rid $floor($calc($gettok($($+(%,price.,%rid,.type),2),2,32) /
$gettok($remove($($+(%,price.tmp.price.,%rid),2),gp,$chr(44)),2,45)))
if ($($+(%,price.calc.,%rid),2) == 0) { .unset $($+(%,price.calc.,%rid),1) }
}
.set %price. $+ %rid $+ .rs $($+(%,price.,%rid,.rs),2) $+ , $+($iif($($+(%,price.calc.,%rid),2) !=
$null,$+($icol($bytes($ifmatch,b)),$chr(32)),),$mcol($($+(%,price.tmp.type.,%rid),2)),$icol($($+(%,price.tmp.name.,%rid),2)),
$chr(32)) $&
$+ $iif($($+(%,price.calc.,%rid),2) != $null,
$pcol($+($bytes($calc($remove($gettok($($+(%,price.tmp.price.,%rid),2),1,45),gp,$chr(44)) * $ifmatch),b),gp)) -
$pcol($+($bytes($calc($remove($gettok($($+(%,price.tmp.price.,%rid),2),2,45),gp,$chr(44)) * $ifmatch),b),gp))
$+($chr(40),$pcol($($+(%,price.tmp.price.,%rid),2)),$chr(41)), $pcol($($+(%,price.tmp.price.,%rid),2)))
.inc $($+(%,price.,%rid,.rvmi),1) $iif($($+(%,price.calc.,%rid),2) !=
$null,$calc($remove($gettok($($+(%,price.tmp.price.,%rid),2),1,45),gp,$chr(44)) *
$ifmatch),$remove($gettok($($+(%,price.tmp.price.,%rid),2),1,45),gp,$chr(44)))
.inc $($+(%,price.,%rid,.rvma),1) $iif($($+(%,price.calc.,%rid),2) !=
$null,$calc($remove($gettok($($+(%,price.tmp.price.,%rid),2),2,45),gp,$chr(44)) *
$ifmatch),$remove($gettok($($+(%,price.tmp.price.,%rid),2),2,45),gp,$chr(44)))
}
if ($($+(%,price.,%rid,.rc),2) < $($+(%,price.,%rid,.rn),2)) {
.next_price %rid
halt
}
}
if ($($+(%,price.read.,%rid),2) == 3) { .set %price.tmp.price. $+ %rid $nohtml(%sr) | inc $($+(%,price.read.,%rid),1) 1
}
if ($($+(%,price.read.,%rid),2) == 2) {
if ($($+(%,price.,%rid,.type),2) == strict) && ($replace($nohtml(%sr),$chr(32),+) != %price.tmp.sendname) {
.set $($+(%,price.read.,%rid),1) -5
}
else {
.set %price.tmp.name. $+ %rid $nohtml(%sr)
inc $($+(%,price.read.,%rid),1) 1
}
}
if ($($+(%,price.read.,%rid),2) == 1) { .set %price.tmp.type. $+ %rid $iif(* * iswm %sr,,(M)) | .inc
$($+(%,price.read.,%rid),1) 1 }
if ($($+(%,price.read.,%rid),2) <= 0) { .inc $($+(%,price.read.,%rid),1) 1 }
}
}
if (** iswm %sr) { .set %price.read. $+ %rid 0 }
}
on *:SOCKCLOSE:price.*: {
var %rid = $right($sockname,5)
if ($($+(%,price.,%rid,.rc),2) < $($+(%,price.,%rid,.rn),2)) {
.next_price %rid
halt
}
if ($numtok($right($($+(%,price.,%rid,.rs),2),-1),44) < $($+(%,price.,%rid,.rc),2)) {
.set %price. $+ %rid $+ .rs $($+(%,price.,%rid,.rs),2) $+ , $pcol(No price found for)
$icol($+($chr(2),$gettok($($+(%,price.,%rid,.item),2),$($+(%,price.,%rid,.rc),2),44),$chr(2)))
}
$($+(%,price.,%rid,.ret),2) $right($($+(%,price.,%rid,.rs),2),-2)
if ($($+(%,price.,%rid,.rn),2) > 1) { $($+(%,price.,%rid,.ret),2) $pcol(Total Value:
$+($bytes($($+(%,price.,%rid,.rvmi),2),b),gp) - $+($bytes($($+(%,price.,%rid,.rvma),2),b),gp)) }
.unset $($+(%,price.*,%rid,*),1)
}
alias -l next_price {
.unset $($+(%,price.read.,$1),1)
var %sn = price. $+ $1
.sockclose %sn
.inc $($+(%,price.,$1,.rc),1) 1
.sockopen %sn zybez.com 80
}
alias nohtml {
var %x,%i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x)
return %x
}
on $*:Text:/^[!@](cmb|combat)/Si:#:{
inc %iddddd 1
set %combat.user [ $+ [ %iddddd ] ] $replace($2-,$chr(32),_)
set %combat.display. [ $+ [ %iddddd ] ] $iif($left($1,1) == @,msg $chan,.notice $nick)
if ( !$2 ) { %combat.display. [ $+ [ %iddddd ] ] 14You must specify a runescape username to search with. }
if ($len($2-) > 12) { %combat.display. [ $+ [ %iddddd ] ] 14The username "02 $+ $2- $+ 14" is too long. | halt }
sockopen $+(combat.,%iddddd) slushpuppy.silverinterlocution.org 80
}
on *:SOCKOPEN:combat.*:{
sockwrite -n $sockname GET /pestcontrol.php?pestcontrol= $+ %combat.user [ $+ [ %iddddd ] ] HTTP/1.1
sockwrite -n $sockname Host: slushpuppy.silverinterlocution.org
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:combat.*:{
var %combat.read
sockread %combat.read
if (*0
* iswm %combat.read) {
%combat.display. [ $+ [ %iddddd ] ] $replace(%combat.user [ $+ [ %iddddd ] ],_,$chr(32))) $+ 14, was not found in the
hiscores for any combat skills. | /unset %combat.* | halt }
if ( isin %combat.read) {
/set %combat.stats [ $+ [ %iddddd ] ] $+(14,$gettok($htmlfree(%combat.read),1,32),:)
$+(02,$gettok($htmlfree(%combat.read),2,32),) $+(14,$gettok($htmlfree(%combat.read),3,32),:)
$+(02,$gettok($htmlfree(%combat.read),4,32),) $+(14,$gettok($htmlfree(%combat.read),5,32),:)
$+(02,$gettok($htmlfree(%combat.read),6,32),) $+(14,$gettok($htmlfree(%combat.read),7,32),:)
$+(02,$gettok($htmlfree(%combat.read),8,32),) $+(14,$gettok($htmlfree(%combat.read),9,32),:)
$+(02,$gettok($htmlfree(%combat.read),10,32),) $+(14,$gettok($htmlfree(%combat.read),11,32),:)
$+(02,$gettok($htmlfree(%combat.read),12,32),) $+(14,$gettok($htmlfree(%combat.read),13,32),:)
$+(02,$gettok($htmlfree(%combat.read),14,32),) }
if ( isin %combat.read) {
/set %combat.2 [ $+ [ %iddddd ] ] 02 $+ $replace(%combat.user [ $+ [ %iddddd ] ],_,$chr(32)) $+(14,is)
$+(02,$htmlfree(%combat.read),) }
if (
isin %combat.read) {
/set %combat.3 [ $+ [ %iddddd ] ] $+(14,with) $+(02,$htmlfree(%combat.read)) $+(14,combat.)
%combat.topline [ $+ [ %iddddd ] ] = %combat.2 [ $+ [ %iddddd ] ] %combat.3 [ $+ [ %iddddd ] ]
%combat.display. [ $+ [ %iddddd ] ] %combat.topline [ $+ [ %iddddd ] ]
%combat.display. [ $+ [ %iddddd ] ] %combat.stats [ $+ [ %iddddd ] ]
/unset %combat.*
}
}
alias -l htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x }
on *:TEXT:?clan*:#:{
if (!$2) {
notice $nick *** [ $+ $col1(Clan) $+ $col2(]: You must supply a name)
halt
}
elseif ($2 == zezima || $2 == n0valyfe) {
notice $nick *** [$+ $col1(Clan) $+ $col2(]: You are not aloud to do that)
}
else {
inc %x 1
set %clan.name. [ $+ [ %x ] ] $replace($2- ,$chr(32),+)
set %clan.style. [ $+ [ %x ] ] $iif($left($1,1) == @,msg $chan,.notice $nick)
sockopen clan. $+ %x runehead.com 80
}
}
on *:SOCKOPEN:clan.*:{
sockwrite -n $sockname GET /clans/search.php?search= $+ %clan.name. [ $+ [ %x ] ] $+ &searchtype=exact
sockwrite -n $sockname Host: $+(www.runehead.com,$crlf,$crlf)
}
on *:SOCKREAD:clan.*:{
if ($sockerr) {
%clan.style. [ $+ [ %x ] ] *** [ $+ $col1(Clan) $+ $col2(]: Error while connecting)
sockclose $sockname
halt
}
else {
var %tmp
sockread %tmp
if $regex(results,%tmp,/No results were found for the exact search (.*)(.*)/) {
%clan.style. [ $+ [ %x ] ] 12 [ $+ $col1(Clan) $+ $col2(]: %clan.name. [ $+ [ %x ] ]) $col1(is in clan:)
$col2($regml(clan,2)) }
if