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.

modify script

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

modify script

Post by hikaro »

Hello,
ive been trying to edit the auto reset into delete only those who has score 0, i dont want to reset the score everymonth but i want to delete those who has score 0. can anybody help me please...
on the score file it looks like:
hebron 10
cipe 7
born 0
bir 0

nah i want to del those who has 0 score.
proc KAOS_NewMonth {min hour day month year} {
global KAOSScoreFile KAOSScore KAOSLastMonthScores

set cmonth [expr $month +1]
set lmonth [KAOSLastMonthName $cmonth]

kaosmsg "[kaos] [kcr] Clearing Monthly Scores \003"

set KAOSMonthFileName "$KAOSScoreFile.$lmonth"

set f [open $KAOSMonthFileName w]
set s 0
foreach n [lsort -decreasing -command sort_KAOSScore [array names KAOSScore]] {
puts $f "$n $KAOSScore($n)"
if {$s < 3} {
if {$KAOSScore($n) > 0} {
set KAOSLastMonthScores($s) "$n $KAOSScore($n)"
} {
set KAOSLastMonthScores($s) "Nobody 0"
}
}
incr s
}
close $f

KAOS_WriteCFG

if [info exists KAOSScore] {unset KAOSScore}

set f [open $KAOSScoreFile w]
puts $f "Nobody 0"
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 »

heh, another animated gif dude, posting unindented code with quote tags

how about not saving names with zero score in the first place?
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

demond wrote:heh, another animated gif dude, posting unindented code with quote tags

how about not saving names with zero score in the first place?
Perhaps its animated gif week and noone told us?
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

demond wrote:heh, another animated gif dude, posting unindented code with quote tags

how about not saving names with zero score in the first place?
I did try about not saving names with zero score but it seems more difficult to do, because the scripts longer and i cant understand it..
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

If you don't understand it, you shouldn't be using it really. You want to modify a code of which you don't even know how it works.
Locked