This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

!rank help pls...

Old posts that have not been replied to for several years.
Locked
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

!rank help pls...

Post by hikaro »

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
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
Locked