hikaro Halfop

Joined: 10 Mar 2004 Posts: 68
|
Posted: Wed Mar 31, 2004 3:28 pm Post subject: !rank help pls... |
|
|
i got trivia tcl and i got a little problem. when i type !rank the bot will give rank 1-5 when i type !rank 3 it will give rank 1 to 3 i want it the bot give only 1 nick... ex !rank 23 then the result will be $nick is in rank 23 with score ....
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
| Quote: |
proc 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
}
| Pls help me with this code... thanks |
|