rendered paste body
alias statsclear { unset %printline1 | unset %stats.* }
alias stat_check {
if (%printline1 != $null) {
if (%stats.Overall.level == $null) { set %stats.Overall.level N/A }
if (%stats.color.strip == on) { %stats.send %stats.text %stat.name - Skill Total: %stats.Overall.level %cmb.printline | %stats.send $strip(%printline1,cb) | statsclear | halt }
if (%stats.color.strip == $null) { %stats.send %stat.color1 $+ %stats.text $+ %stat.color2 %stat.name %stat.color1 $+ - Skill Total: $+ %stat.color2 %stats.Overall.level | %stats.send %printline1 | statsclear | halt }
}
else { %stats.send %stat.color1 $+ 4[12 Notice 4] 4This person doesnt appear on the hiscores for any skill currently listed in the hiscores. | statsclear | halt }
}
on $*:text:/^[!@.](stats) .{1,13}$/Si:#:{
if ($sock(stats).status != $null) { notice $nick The stats script is currently in use. Try again.... now! | halt }
if ($left($1,1) == @) && ($left($remove($chan(#).mode,+),1) == c) || ($left($remove($chan(#).mode,+),2) == c) { set %stats.color.strip on }
set %stats.nick $nick | set %stats.send $iif($left($1,1) == @,msg $chan,notice $nick) | set %stats.name $replace($2-,$chr(32),+) | set %stat.color1 $chr(3) $+ 12 | set %stat.color2 $chr(3) $+ 13
sockopen stats vulcan.ueuo.com 80
}
on *:sockopen:stats:{
sockwrite -nt $sockname GET /geniestats.php?rsname= $+ %stats.name HTTP/1.0
sockwrite -nt $sockname Host: vulcan.ueuo.com $+ $crlf $+ $crlf
}
on *:sockread:stats:{
if ($sockerr > 0) { .notice %stat.called.nick Error: Try again later. | halt }
var %read | sockread %read
if (<b>Personal isin %read) { set %stat.name $remove(%read,Personal $+ $chr(32),Scores $+ $chr(32),For $+ $chr(32),<b>,</b>) | set %stats.text $remove(%read,<b>,</b>) | set %stats.text $left(%stats.text,- $+ $len(%stat.name)) }
tokenize 124 $remove(%read,Genie:)
if ($0 == 4) { set %printline1 %printline1 $eval($+(%stat.color1,$1,:,%stat.color2),2) $3 | set %stats. $+ $1 $+ .level $3 }
}
on *:sockclose:stats:{ stat_check }