alias c1 { return $+( 4 $1-,) }
alias c2 { return $+( 7 $1-,) }
on *:text:*:#: {
tokenize 32 $strip($1-)
if ($left($1,1) !isin @!.) halt
if ($right($1,-1) == stats) var %style = astats
elseif ($regex($1,/co?mb(at)?/Si)) var %style = combat
elseif ($setskill($remove($1,@,!,.))) var %style = istat, %skill = $setskill($remove($1,@,!,.))
elseif ($right($1,-1) == defname) && ($2) {
writeini DefRSN.ini RSNs $mask($fulladdress,3) $replace($2-,$chr(32),-)
.notice $nick You're default RSN for the host $mask($fulladdress,3) has been set to $2-
halt
}
else halt
inc %ID
if ($len($2-) > 12) {
$($+(%,stats.display.,%ID),2) $c1(The nick) $c2($2-) $c1(is too long)
cleanup %ID
halt
}
elseif ($2) set $+(%,stats.rsn.,%ID) $replace($2-,$chr(32),-)
elseif ($readini(DefRSN.ini,RSNs,$mask($fulladdress,3))) set $+(%,stats.rsn.,%ID) $ifmatch
elseif ($readini(DefRSN.ini,RSNs,$nick)) set $+(%,stats.rsn.,%ID) $ifmatch
else set $+(%,stats.rsn.,%ID) $nick
set $+(%,stats.style.,%ID) %style
set $+(%,stats.skill.,%ID) %skill
set $+(%,stats.display.,%ID) $iif($left($1,1) == @,msg $chan,notice $nick)
sockopen $+(stats.,%ID) hiscore.runescape.com 80
}
on *:sockopen:stats.*: {
var %id = $gettok($sockname,2,46)
sockwrite -n $sockname GET /lang/en/aff/runescape/hiscorepersonal.ws?user1= $+ $($+(%,stats.rsn.,%ID),2) HTTP/1.1
sockwrite -n $sockname Host: hiscore.runescape.com $+ $crlf $+ $crlf
}
on *:sockread:stats.*: {
sockread &Incoming
bwrite $sockname -1 -1 &Incoming
if ($bfind(&Incoming, 1,