on $*:TEXT:/^[!@](stats|stat)+./Si:#: { set %display.stats $iif($left($1,1) == @,msg $chan,/notice $nick) if ($chr(32) isin $2-) { set %user $replace($2-,$chr(32),$chr(95)) } else { set %user $2 } sockopen stats $+ $r(1,10) slushpuppy.silverinterlocution.org 80 } on *:SOCKOPEN:stats*: { sockwrite -nt $sockname GET /rsstats.php?stats= $+ %user HTTP/1.1 sockwrite -nt $sockname Host: slushpuppy.silverinterlocution.org $+ $crlf $+ $crlf } on *:SOCKREAD:stats*: { if ($sockerr > 0) { unset %user | unset %display | sockclose $sockname | halt } var %tempread sockread -f %tempread if (*does not appear* iswm %tempread) { %display.stats %user does not appear in the Runescape High Scores list for any skills. unset %display.stats unset %user } elseif (*:* iswm %tempread) && (
isin %tempread) { /tokenize 32 $htmlfree(%tempread) %display.stats $c1(Stats for:) $c2(%user) %display.stats $c1($1) $c2($2) $c1($3) $c2($4) $c1($5) $c2($6) $c1($7) $c2($8) $c1($9) $c2($10) $c1($11) $c2($12) $c1($13) $c2($14) $c1($15) $c2($16) $c1($17) $c2($18) $c1($19) $c2($20) $c1($21) $c2($22) $c1($23) $c2($24) $c1($25) $c2($26) $c1($27) $c2($28) $c1($29) $c2($30) $c1($31) $c2($32) $c1($33) $c2($34) $c1($35) $c2($36) if ($37- != $null) %display.stats $c1($37) $c2($38) $c1($39) $c2($40) $c1($41) $c2($42) $c1($43) $c2($44) $c1($45) $c2($46) $c1($47) $c2($48) } } alias htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) | return %x } alias c1 { return $+(10 $+ $chr(44) $+ 01,$1-,) } alias c2 { return $+(01,$1-, ) }