this is the part of the script.. pls help me out coz it just like flooding the channel when i type !rank 15 or something
Pls help me with this code... thanksproc mx_spit_rank {how where length} {
global timerankreset
global userlist
global manjaconf
variable pos 1
variable prevscore 0
variable entries 0
variable lines ""
# anybody with a point?
foreach u [array names userlist] {
array set aa $userlist($u)
if {$aa(score) > 0} {
set entries 1
break
}
}
if {$entries == 0} {
lappend lines "Topscore list Kosong"
} else {
if {$length > $manjaconf(maxranklines)} {
set length $manjaconf(maxranklines)
}
lappend lines "6TopScore Scramble Game ver8.9"
set pos 1
set prevscore 0
foreach u [lsort -command mx_sortrank [array names userlist]] {
array set aa $userlist($u)
if {$aa(score) == 0} { break }
if {$pos > $length && $aa(score) != $prevscore} { break }
if {$aa(score) == $prevscore} {
set text "= "
} else {
set text [format "%2d " $pos]
}
set text [format "$text %12s :: %5d pts." $u $aa(score)]
if {$pos == 1} {
set text "$text"
}
lappend lines $text
set prevscore $aa(score)
incr pos
}
lappend lines "6Congrats!"
}
# spit lines
foreach line $lines {
if {$how == "NOTC"} {
mxirc_say $where $line
# mxirc_notc $where $line
} else {
mxirc_say $where $line
}
}
return 1
}