/Count { var %x = 1, %i = 1 var %Ocount = 0, %Hcount = 0, %Vcount = 0, %chancount = 0, %infcount = 0, %usercount = 0 while (%i <= $scon(0)) { scon %i { while ($chan(%x) <= $chan(0)) { if ($me isop $chan(%x)) { inc %Ocount | inc %Ousercount = $nick($chan(%x),0) } elseif ($me ishop $chan(%x)) { inc %Hcount | inc %Husercount = $nick($chan(%x),0) } elseif ($me isvoice $chan(%x)) { inc %Vcount | inc %Vusercount = $nick($chan(%x),0) } if ($me isop $chan(%x)) inc %infcount $nick($chan(%x),0,$iif($me isop $chan(%x),rvh)) if ($me ishop $chan(%x)) inc %infcount $nick($chan(%x),0,$iif($me ishop $chan(%x),rv)) inc %usercount $nick($chan(%x),0) inc %Chancount inc %x } } inc %i var %x = 1 } scid -r msg $active 6 I am: Opped in7 %ocount $+ 6 ,Halfopped in7 %hcount $+ 6 ,Voiced in7 %Vcount $+ 6 ,and regular in7 $calc(%chancount - %Ocount - %Hcount - %Vcount) 6 out of 7 %chancount 6 channels over7 $scid(0) 6 networks. I control 7 $+(%infcount,/,%usercount) 6 users. } } alias c1 { return $+( 7,$1-,7) } alias c2 { return $+( 6,$1-,6) } on *:text:*:#: { if (%bot. [ $+ [ $chan ] ] == off) { halt } tokenize 32 $remove($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) == setrsn) && ($2) { writeini DefRSN.ini RSNs $mask($fulladdress,3) $replace($2-,$chr(32),_) writeini DefRSN.ini RSNs $nick $replace($2-,$chr(32),_) .notice $nick $c1(Your default RSN has been set to) $c2($2-) $+ $c1(.) halt } else halt inc %ID if (#* iswm $2) && ($right($2,-1) isnum) { set $+(%,stats.goal.,%ID) $right($2,-1) tokenize 32 $1 $3- } if ($len($2-) > 12) { .notice $nick $c1(The RSN) $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, ).text) makehash $sockname elseif ($bfind(&Incoming, 1, does not feature in the hiscores.).text) { $($+(%,stats.display.,%ID),2) $c1(The RSN) $c2($+([,$($+(%,stats.rsn.,%ID),2),])) $c1(does not appear in the highscores.) cleanup $gettok($sockname,2,46) } } alias -l makehash { var %file = $1 bread %file 1 $file(%file).size &stats var %currentstat, %x = 1 while (%x) { var %x = $bfind(&stats,$calc(%x + 1),