need help a little on this script, please
output is
now i want the output like this:
thank you all..
tcl
#############################################################################################
# #
# Idle Top 5! #
# Based on Idle King script by Ozh. #
# That script was originally named "Idle des jeunes" in French, which is funny as hell. #
# #
# Contact stuff : #
# TrashF, TrashF@iki.fi, QuakeNet. #
# #
#############################################################################################
#just type !idle on channel to get the top 5 idlers
bind pub - !idle idle_getnick
proc idle_getnick {nick mask hand chan args} {
global botnick
set idlaajia 0
set idle_1 "0"
set idle_2 "0"
set idle_3 "0"
set idle_4 "0"
set idle_5 "0"
set idle_1_nick "N/A"
set idle_2_nick "N/A"
set idle_3_nick "N/A"
set idle_4_nick "N/A"
set idle_5_nick "N/A"
foreach mec [chanlist $chan] {
set idle_idle [getchanidle $mec $chan]
if {$idle_idle > $idle_1 && $mec != $botnick && $mec != "L"} {set idle_1 $idle_idle ; set idle_1_nick $mec ; incr idlaajia }
}
foreach mec [chanlist $chan] {
set idle_idle [getchanidle $mec $chan]
if {$idle_idle > $idle_2 && $mec != $idle_1_nick && $mec != $botnick && $mec != "L"} {set idle_2 $idle_idle ; set idle_2_nick $mec ; incr idlaajia}
}
foreach mec [chanlist $chan] {
set idle_idle [getchanidle $mec $chan]
if {$idle_idle > $idle_3 && $mec != $idle_1_nick && $mec != $idle_2_nick && $mec != $botnick && $mec != "L"} {set idle_3 $idle_idle ; set idle_3_nick $mec ; incr idlaajia}
}
foreach mec [chanlist $chan] {
set idle_idle [getchanidle $mec $chan]
if {$idle_idle > $idle_4 && $mec != $idle_1_nick && $mec != $idle_2_nick && $mec != $idle_3_nick && $mec != $botnick && $mec != "L"} {set idle_4 $idle_idle ; set idle_4_nick $mec ; incr idlaajia}
}
foreach mec [chanlist $chan] {
set idle_idle [getchanidle $mec $chan]
if {$idle_idle > $idle_5 && $mec != $idle_1_nick && $mec != $idle_2_nick && $mec != $idle_3_nick && $mec != $idle_4_nick && $mec != $botnick && $mec != "L"} {set idle_5 $idle_idle ; set idle_5_nick $mec ; incr idlaajia}
}
#here you can change the output method if you want.
if {$idlaajia > "5"} {set idlaajia 5}
putchan $chan "# Top $idlaajia Idlers #"
if {$idle_1_nick != "N/A"} { putchan $chan "\00304#1.\003 \00302$idle_1_nick\003 ($idle_1 minutes); \00304#2.\003 \00302$idle_2_nick\003 ($idle_2 minutes); \00304#3.\003 \00302$idle_3_nick\003 ($idle_3 minutes); \00304#4.\003 \00302$idle_4_nick\003 ($idle_4 minutes); \00304#5.\003 \00302$idle_5_nick\003 ($idle_5 minutes)" }
}
putlog "Idle Top 5 by TrashF @ QNet loaded."
output is
tcl
<user>!idle
<bot> # Top 5 Idlers #
<bot> #1. user1 (455 minutes); #2. user2 (455 minutes); #3. user3 (455 minutes); #4. user4 (455 minutes); #5. user5 (455 minutes);
now i want the output like this:
tcl
<user>!idle
<bot> # Top 5 Idlers #
<bot> #1. user1 (1d:4h:22m:22s); #2. user2 (2d:4h:22m:22s); #3. user3 (3d:4h:22m:22s); #4. user4 (4d:4h:22m:22s); #5. user5 (5d:4h:22m:22s)
thank you all..