rendered paste bodyon $*:text:/^[!@](stats|rsstats)/Si:#: {
set %sway $iif($left($1,1) == @,msg $chan,notice $nick)
if ($sock(stats)) %sway Please hold, bot is busy
elseif ($2 == $null) %sway You must supply a user, Syntax: !stats runescapename
else {
set %statuser $2
sockopen stats o-ss.net 80
}
}
on *:sockopen:stats: {
sockwrite -nt $sockname GET /parsers/oneline/stats.php?user= $+ %statuser HTTP/1.1
sockwrite -nt $sockname Host: o-ss.net
sockwrite -nt $sockname $crlf
}
on *:sockread:stats: {
var %stattext
sockread %stattext
tokenize 32 %stattext
if (*compare* iswm %stattext) {
%sway $+ %statuser was not featured in the highscores for any skill | { halt }
}
elseif (*end* iswm %stattext) {
%sway Stats for %statuser $+ :
%sway $replace(%stattext,|,|,END,|,Overall,Overall,Attack,Attack,Defence,Defence,Strength,Strength,Hitpoints,Hitpoints,Ranged,Ranged,Prayer,Prayer,Magic,Magic,Cooking,Cooking,Woodcutting,Woodcutting,Fletching,Fletching,Fishing,Fishing,Firemaking,Firemaking,Crafting,Crafting,Smithing,Smithing,Mining,Mining,Herblore,Herblore,Agility,Agility,Thieving,Thieving,Slayer,Slayer,Farming,Farming,Runecraft,Runecraft,Hunter,Hunter,Construction,Construction)
unset %sway
unset %stattext
sockclose stats
}
}