Sorry Russell but im sure that is just wrong in so many ways dude
on TEXT {
might as well use no #group (u never switch it off)
timer on wrong line (typo?) and if so timers are all fixed to go off in 2 seconds so you flood in two seconds instead
$sort used instead of $sorttok; if not its a custom alias you didnt define
%uptime is (currently) undefinded (below assumes it was set from a previous execution of the script)
uptime hash table is currenlty (below assumes it wasset from a previous execution of the script)
$hfind i think needs the $hfind().data property (might be wrong on this, but arent you checking the uptime values, the items are the nicks?)
You write to a file uptime.txt the following line " $nick $gettok(%uptime,1,32) " then replace that line with " $nick $gettok(%uptime,2,32) " up to 4
This is also the lowest 4 values not the highest (assuming $sorttok used)
Countinue to loop after %a > 4 (could be accepted as its creating a %nick list of nicks)
raw 317 {
$nick(#,%a) is undefined
set command has a =
used addtok so If 2 nicks return same uptime only one is recorded (as mentioned)
I would wrote something BUT i get no raw 317's on the irc server i use, so couldnt test it out
;
;Designed to be run on multiple channels but only one at any one time.
;
on *:input:#:{ if ($1- == !whois) { mass.whois $chan } }
on *:text:!whois:#:{ mass.whois $chan }
;
; $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)
dec %i
}
set %uptime.top4
}
}
;
;$2 = nick
;$4 = connect time?
raw 317:*:{ set %uptime.top4 $gettok($replace($gettok($sorttok($cr $cr $cr $cr %uptime.top4 $+($right($+(0000000000,$calc($ctime - $4)),10),@,$2),32),-4-,32),$cr,$chr(32)),1-,32) }
;
; $1 = $chan
; %uptime.top4 = 0000000001@nickA 0000000002@nickB 0000000003@nickC 0000000004@nickD (maybe less than 4 nicks total)
alias mass.whois.results {
set %uptime.top4.nicks
set %uptime.top4.times
var %i = $numtok(%uptime.top4,32)
while (%i) {
set %uptime.top4.times %uptime.top4.times $calc($gettok($gettok(%uptime.top4,%i,32),1,64))
set %uptime.top4.nicks %uptime.top4.nicks $gettok($gettok(%uptime.top4,%i,32),2,64)
dec %i
}
unset %uptime.top4
echo -s Top 4 uptimes on $1 are %uptime.top4.times
echo -s Top 4 uptime nicks on $1 are %uptime.top4.nicks
; ^ do what you well here
}