on $*:text:/^[!@](stats|rsstats)/Si:#: {
set %sway $iif($left($1,1) == 12 @,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
}
}
on $*:TEXT:/^[!@.]cmb */si:#: {
if ($sock(cmb)) sockclose cmb
set %return $iif($left($1,1) == 12 @,msg $chan,notice $nick)
set %cmb $2
if (!$2) set %cmb $nick
sockopen cmb www.slushpuppy.silverinterlocution.org 80
}
on *:SOCKOPEN:cmb: {
sockwrite -nt $sockname GET /pestcontrol.php?pestcontrol= $+ %cmb HTTP/1.1
sockwrite -nt $sockname Host: www.slushpuppy.silverinterlocution.org
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:cmb: {
if ($sockerr) {
%return Socket Error: $sockname $+ . Error code: $sockerr Please inform $me of this error message.
halt
}
var %read
sockread %read
if (*does not feature in the hiscores* iswm %read) {
%return %cmb Does not come up with any skill in the high scores!
sockclose $sockname
halt
}
if (
isin %read) { set %combat $remove(%read,
) }
if ( isin %read) { set %style $remove(%read,,) }
if ( isin %read) {
%return Combat Stats for %cmb $+ : %combat %style
%return $remove(%read,,,$gettok(%read,2-3,32))
sockclose $sockname
unset %return
unset %combat
unset %style
unset %cmb
}
}