#on_text_word on
on *:text:%word:#channel:{
inc %usr. [ $+ [ $nick ] ]
msg # User $nick won! he got %usr. [ $+ [ $nick ] ] score!
disable #on_text_word
}
#on_text_word end
;
; When next clue given do follwoing two commands
; set %word word value here
; enable #on_text_word
;
alias top10 {
unset %top10
var %i = $var(%usr.*,0)
while (%i) {
%top10 = $gettok( $sorttok( %top10 $+([ [ $var(%usr.*,%i) ] ],$chr(160),$mid($var(%usr.*,%i),6)) ,32,nr) ,1-10,32)
dec %i
}
}
; top 10 names held in %top10 format is score*nick score*nick etc etc ( * represents $chr(160) )
; to get the 1st to 10th persons score*nick you use $gettok(%top10,X,32) X being 1 to 10
; to get that persons score you use $gettok( $gettok(%top10,X,32) ,1,160)
; to get that persons nick you use $gettok( $gettok(%top10,X,32) ,2-,160)
;
; msg # User $gettok( $gettok(%top10,1,32) ,2-,160) won! he got $gettok( $gettok(%top10,1,32) ,1,160) score!
;
; msg # Top Ten Users are $replacex(%top10,$chr(32),$+($chr(32),-,$chr(32)))
;