poborski commented on a Page, RuneScape Stats  -  May 08, 2011

on $:TEXT:/^!@.?stats /Si:#: {
if (!$2) { .notice $nick Enter an RSN to look up! | halt }
if ($len($2) > 12) { .notice $nick RSN too long! | halt }
var %x = 1
while ($sock(rsstats. $+ %x)) inc %x
.set %target. $+ %x $iif($left($1,1) == @,.msg $chan,.notice $nick)
.set %rsn. $+ %x $replace($2-,$chr(32),+)
sockopen rsstats. $+ %x hiscore.runescape.com 80
}
on :sockopen:rsstats.: {
var %x = $right($sockname,1)
if ($sockerr > 0) { %target. [ $+ [ %x ] ] Socket Error: $sockerr | cleanup $sockname | halt }
sockwrite -nt $sockname GET /lookup.php?type=stats&user= $+ $3 ] HTTP/1.1
sockwrite -nt $sockname Host: hiscore.runescape.com 80
sockwrite -nt $sockname $crlf
}
on :sockread:rsstats.: {
var %x = $right($sockname,1)
if ($sockerr > 0) { %target. [ $+ [ %x ] ] Socket Error: $sockerr | cleanup $sockname | halt }
var %read | sockread %read
if (: 0 isin %read) { %target. [ $+ [ %x ] ] %rsn. [ $+ [ %x ] ] is not in the Hi-Scores. You have to be in the top million of any skill with a skill level of at least 30. | cleanup $sockname }
if (combat isin %read) { %target. [ $+ [ %x ] ] $remove(%read,END) }
if (overall isin %read) { %target. [ $+ [ %x ] ] $remove(%read,END,|) | cleanup $sockname }
}
alias cleanup {
unset %target. $+ $right($1,1)
unset %rsn. $+ $right($1,1)
sockclose $1
}

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.