__henke wrote:Hey!
Nice script. Is there any way to use this thing with multiple channels?
By using arrays instead of the current method, that would be possible, yes. But there's another problems with this tcl since it only loads the function one time, and then stops update the log, and I presume that it's real purpose is to log the channel all the time, to the logfile?
This is what I changed, to make it work:
At the top of the tcl:
Code: Select all
# Seconds to loop before next update (instead of the regular timer)
set mrtglooptimer 60
In the end of proc LogUsers:
Code: Select all
# Clean up duplicates
foreach tmr [utimers] {if {[lindex $tmr 1]=="LogUsers"} {killutimer [lindex $tmr 2]}}
# Reload timer
utimer 1 reloadLogUsers
Added this
Code: Select all
# Fixing some visual bugs for utimer, like this (when a timer expires during the cleanup):
# [13:41] <BotNick> [13:41] Tcl error in script for 'timer2985':
proc reloadLogUsers { } {
global mrtglooptimer
utimer $mrtglooptimer LogUsers
}
And finally
Replace ...
... with ...
Code: Select all
## Initialize Logger
utimer $mrtglooptimer LogUsers