It works, except one thing.
If the user leaves the chat by cutting the connection, the script doesnt update the whosonline list.
Could you help me an tell how i get the script updating the whosonline list if someone´s quitting?
I´ve tried it with this block:
Code: Select all
# Check for a QUIT
proc hung_up {nick uhost handle chan msg} {
regsub -all "\#" $chan "" chan
global cc_chanlist
if {[lsearch $cc_chanlist $chan] != -1} {cc_countusers $chan}
return 0
}
TiA!
Code: Select all
# FILENAME: CHANCOUNT.TCL
# VERSION: 0.8 (BETA)
# DATE: 8/18/2002
# AUTHOR: Mapherick^ApL <mapherick at apl-productions.org>
# PURPOSE: To puts the current number of people in a predefined (list of) channel(s)
# $cc_outptfile: filename to write to
# $cc_outptpath: path to outputfile from your eggdrop dir
set cc_outptpath "../pjircapplet/whosonline/"
set cc_outptfile "whosonline.txt"
# $cc_chanlist
# List of channels to monitor (ommit #)
set cc_chanlist {sheepworld BlackSheep Seelsorge Flirtwiese Themenabend}
bind join - * cc_join
bind part - * cc_part
bind sign - * cc_sign
proc cc_countusers {chan} {
global cc_outptfile cc_outptpath
set c [catch {set fd [open "$cc_outptpath$chan.$cc_outptfile" w]} reason]
set cc_numusers 0
set cc_nicks [chanlist "\#$chan"]
puts $fd [join $cc_nicks]
foreach n $cc_nicks {
incr cc_numusers
}
if $c {
set msg "CHANCOUNT.TCL: ERROR: Error opening outpt file"
putlog $msg
catch {if [info exists fd] {close $fd}}
return 0
} else {
puts $fd $cc_numusers
catch {close $fd}
}
return 0
}
proc cc_join {nick uhost handle chan} {
regsub -all "\#" $chan "" chan
global cc_chanlist
if {[lsearch $cc_chanlist $chan] != -1} {cc_countusers $chan}
return 0
}
proc cc_part {nick uhost handle chan msg} {
regsub -all "\#" $chan "" chan
global cc_chanlist
if {[lsearch $cc_chanlist $chan] != -1} {cc_countusers $chan}
return 0
}
proc cc_sign {nick uhost handle chan msg} {
regsub -all "\#" $chan "" chan
global cc_chanlist
if {[lsearch $cc_chanlist $chan] != -1} {cc_countusers $chan}
return 0
}
# Check for a QUIT
proc hung_up {nick uhost handle chan msg} {
regsub -all "\#" $chan "" chan
global cc_chanlist
if {[lsearch $cc_chanlist $chan] != -1} {cc_countusers $chan}
return 0
}
putlog "\002WHOSONLINE:\002 whosonline.tcl Version1 is loaded."