rendered paste bodyalias stats { sockopen stats hiscore.runescape.com 80 | set %user $replace($regsubex($lower($1-),/\b(.)/g,$upper(\1)),$chr(32),_) }
on *:SOCKOPEN:stats:{ sockwrite -nt stats GET /index_lite.ws?player= $+ %user HTTP/1.1 | sockwrite -nt stats Host: hiscore.runescape.com | sockwrite -nt stats $crlf }
on *:SOCKREAD:stats:{ var %read | sockread %read | if (Sorry, the page you were looking for was not found. isin %read) { msg $active 10[07Stats10]:07 $replace(%user,_,$chr(32)) 10was not found in the RuneScape hiscores. | sockclose stats | unset %user | halt } | if (*,*,* iswm %read) { inc %stats | writeini stats2.ini stats %stats %read } }
on *:SOCKCLOSE:stats:{ var %x 1 | while (%x <= 25) { var %lol %lol $iif(*-1* iswm $readini(stats2.ini,stats,%x),$null,$+($chr(3),10,$statkl(%x)) $+($chr(3),07,$gettok($readini(stats2.ini,stats,%x),2,44)) $chr(124)) | inc %x } | msg $active 10[07 $+ $replace(%user,_,$chr(32)) $+ 10]: $gettok(%lol,1-17,124) | $iif($gettok(%lol,18-25,124),msg $active 10[07 $+ $replace(%user,_,$chr(32)) $+ 10]: $v1,$null) | unset %user %stats | remini stats2.ini stats }
alias statkl {
if ($1 == 1) return Overall
elseif ($1 == 2) return Attack
elseif ($1 == 3) return Defence
elseif ($1 == 4) return Strength
elseif ($1 == 5) return Hitpoints
elseif ($1 == 6) return Range
elseif ($1 == 7) return Prayer
elseif ($1 == 8) return Magic
elseif ($1 == 9) return Cooking
elseif ($1 == 10) return Woodcutting
elseif ($1 == 11) return Fletching
elseif ($1 == 12) return Fishing
elseif ($1 == 13) return Firemaking
elseif ($1 == 14) return Crafting
elseif ($1 == 15) return Smithing
elseif ($1 == 16) return Mining
elseif ($1 == 17) return Herblore
elseif ($1 == 18) return Agility
elseif ($1 == 19) return Thieving
elseif ($1 == 20) return Slayer
elseif ($1 == 21) return Farming
elseif ($1 == 22) return Runecrafting
elseif ($1 == 23) return Hunter
elseif ($1 == 24) return Construction
elseif ($1 == 25) return Summoning
}