Code: Select all
set f [open score.txt]
foreach line [split [read $f]] {
foreach {n s} [split $line] {
set score($n) [list $n $s]
}
}
close $f
Code: Select all
if {[info exists score([string tolower $nick])]} {
incr score([string tolower $nick]) $pointvalue
} else {
set score([string tolower $nick]) $pointvalue
}
writescore $nick