Code I found if someone can modify it:
PHP Code:
# Location to save files
set location "/home/ircadmin/MonkBOT/userlists/"
# Channel to watch
set chan "#unrealplayground"
# How often to update file in minutes
set updatetime 2
# Check to see if the timer is running - only needed really during a .rehash
putlog "users2list.tcl v1.0 has started"
if {![info exists fileusers_running]} {
timer $updatetime fileusers
set fileusers_running 1
}
proc fileusers {} {
global updatetime chan file location
if {![validchan $chan]} {
putlog "ERROR - users2file.tcl - I am not on $chan, so I cannot output lists"
return 1
}
set l1 [chanlist $chan]
set l2 {}
set l3 {}
foreach u $l1 {
if {[isop $u $chan]} {
lappend l3 "@"
} elseif {[isvoice $u $chan]} {
lappend l3 "+v"
} else {
lappend l3 ""
}
lappend l3 $u
lappend l3 [getchanidle $u $chan]
lappend l3 "[getchanhost $u $chan]"
lappend l2 [join $l3 {,}]
set l3 {}
}
#write the files
set fp [open "${location}${chan}.users.txt" w]
puts $fp [join $l1 {,}]
close $fp
set fp [open "${location}${chan}.status.txt" w]
puts $fp [join $l2 n]
close $fp
#restart the timer
timer $updatetime fileusers
}