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.

game score

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

game score

Post by hikaro »

hello, i need help again with my game score.

this it the proc of !rank, this code display rank 1 to 5 with command !rank. I want it like when i do command !rank2 if will display only rank 2 or if i do !rank31 it will this play those who are on rank 31... is it possible to do this?
here is the proc


proc KAOSTop5 {nick uhost hand chan args} {
global KAOSChannel KAOSScoreFile KAOSPointsName
if {$chan != $KAOSChannel} {return}
set KWinners "Top5 $KAOSPointsName "
set f [open $KAOSScoreFile r]
for { set s 0 } { $s < 5 } { incr s } {
gets $f KAOSTotals
if {[lindex $KAOSTotals 1] > 0} {
append KWinners "15,1<[expr $s +1]>0,1 [lindex $KAOSTotals 0]4,1 [lindex $KAOSTotals 1] "
} {
append KWinners "<[expr $s +1]> Nobody 0 "
}
}
kaosmsg "$KWinners"
close $f
}
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

here's how to read from a file by line number (in your case, rank):

Code: Select all

if ![catch {set f [open file.txt]}] {
  while {![eof $f]} {lappend lines [gets $f]}; close $f
  set line [lindex $lines [expr $num - 1]]
} {set line "couldn't open file"}
I'd patch your script but that circling dude of yours drives me crazy :P
Locked