I have a uptime addon made by this forum (thanx), but I'm trying to make it bigger.
By now, when I type !scan10 it scan the channel and sends to chan the 10 nicks with the longest uptime, but now I'm trying to save the best uptime of each nick: When a !scan10 is done, if the nick shown have a better uptime that the last time record it for the next in a text file (I've done a example in the 1rst one).

alias -l topXnumber { return 10 }
;
;Designed to be run on multiple channels but only one at any one time.
;
on *:input:#:{ if ($1- == .scan10) { mass.whois $chan } }
on 10:text:!scan10:#:{ if ($timer(scan)) { notice $nick Espere't una estona, falten $duration($timer(scan).secs) per poder tornar a escanejar } | else { notice $nick escanejant | mass.whois $chan | /timerscan 1 3600 /notice $me ja ta } }
;
; $1 = $chan
alias mass.whois {
if (!%mass.whois) {
set $+(-u,$calc($nick($1,0) * 2 + 4)) %mass.whois $true
.timer.mass.whois.result 1 $calc($nick($1,0) * 2 + 2) mass.whois.results $1
var %i = $nick($1,0)
while (%i) {
.timer 1 $calc(%i * 2) whois $nick($1,%i) $nick($1,%i)
dec %i
}
set %uptime.topX
}
}
;
;$2 = nick
;$4 = connect time?
raw 317:*:{ set -s %uptime.topX $gettok($replace($gettok($sorttok($str($cr $+ $chr(32),$topXnumber) %uptime.topX $+($right($+(0000000000,$calc($ctime - $4)),10),@,$2),32),$+(-,$topXnumber,-),32),$cr,$chr(32)),1-,32) }
;
; $1 = $chan
; %uptime.topX = [email]0000000001@nickA[/email] [email]0000000002@nickB[/email] [email]0000000003@nickC[/email] [email]0000000004@nickD[/email] (maybe less than X nicks total)
alias mass.whois.results {
set %uptime.topX.nicks
set %uptime.topX.times
var %i = $numtok(%uptime.topX,32)
while (%i) {
set %uptime.topX.times %uptime.topX.times $calc($gettok($gettok(%uptime.topX,%i,32),1,64))
set %uptime.topX.nicks %uptime.topX.nicks $gettok($gettok(%uptime.topX,%i,32),2,64)
dec %i
}
unset %uptime.topX
echo -s Top X uptimes on $1 are %uptime.topX.times amb un temps de $duration($calc(%uptime.topX.times))
echo -s Top X uptime nicks on $1 are %uptime.topX.nicks
write -c c:\stadistiques\up.txt Uptimes
write c:\stadistiques\up.txt 1r - $gettok(%uptime.topX.nicks,1,32) --> $duration($calc($gettok(%uptime.topX.times,1,32))) | if ($read(c:\stadistiques\nicks\$gettok(%uptime.topX.nicks,1,32).txt, 1) < $gettok(%uptime.topX.times,1,32)) { write -c c:\stadistiques\nicks\$gettok(%uptime.topX.nicks,1,32).txt $gettok(%uptime.topX.times,1,32) }
write c:\stadistiques\up.txt 3r - $gettok(%uptime.topX.nicks,3,32) --> $duration($calc($gettok(%uptime.topX.times,3,32)))
write c:\stadistiques\up.txt 4rt - $gettok(%uptime.topX.nicks,4,32) --> $duration($calc($gettok(%uptime.topX.times,4,32)))
write c:\stadistiques\up.txt 5e - $gettok(%uptime.topX.nicks,5,32) --> $duration($calc($gettok(%uptime.topX.times,5,32)))
write c:\stadistiques\up.txt 6e - $gettok(%uptime.topX.nicks,6,32) --> $duration($calc($gettok(%uptime.topX.times,6,32)))
write c:\stadistiques\up.txt 7e - $gettok(%uptime.topX.nicks,7,32) --> $duration($calc($gettok(%uptime.topX.times,7,32)))
write c:\stadistiques\up.txt 8e - $gettok(%uptime.topX.nicks,8,32) --> $duration($calc($gettok(%uptime.topX.times,8,32)))
write c:\stadistiques\up.txt 9e - $gettok(%uptime.topX.nicks,9,32) --> $duration($calc($gettok(%uptime.topX.times,9,32)))
write c:\stadistiques\up.txt 10e - $gettok(%uptime.topX.nicks,10,32) --> $duration($calc($gettok(%uptime.topX.times,10,32)))

var %m = $numtok(%uptime.topX,32), %i = 1
while (%i <= %m) {
write c:\up.txt # $+ %i lloc hi ha $gettok(%uptime.topX.nicks,%i,32) amb un temps de $duration($calc($gettok(%uptime.topX.times,%i,32)))
inc %i
}
play #la_penya_del_pollastre c:\stadistiques\up.txt 500
; ^ do what you well here
}