on $*:text:/^[!@.]stats* /Si:*:{ if ($sock(stats)) { sockclose stats } set %nick $nick set %rsn $2 set %display $iif($left($1,1) == @,msg $chan,.notice $nick) sockopen stats slushpuppy.silverinterlocution.org 80 } on *:SOCKOPEN:stats:{ sockwrite -nt $sockname GET /rsstats.php?stats= $+ %rsn HTTP/1.1 sockwrite -nt $sockname Host: slushpuppy.silverinterlocution.org $+ $crlf $+ $crlf } on *:SOCKREAD:stats:{ if ($sockerr) { %display Socket error | unset %display | unset %rsn | sockclose $sockname | halt } else { var %read sockread -f %read if (*does not feature in the hiscores.* iswm %read) { %display %rsn does not apear in the highscores of runescape. } if (*|* iswm %read) { /set %read $remove(%read,
) %display $chr(91) $+ %nick $+ $chr(93) $htmlfree(%read) } } } alias htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) | return %x }