Well having this problem now
Code: Select all
set file "home/warseeker/channels/chanfile"
set setting(minusers) "15"
set setting(privechan) "#warseeker.prive"
bind pub m|m !gc global:check
proc global:check {nick uhost hand chan text} {
foreach chan [channels] {
check:forward $chan
}
}
proc check:forward {chan} {
global file setting
if {[llength [chanlist $chan] < $setting(minusers)]} {
set exists 0
set chan [lindex [split $arg] 0]
foreach temp [split [string tolower [read [set inf [open $file]]]] "\n"][close $inf] {
if {[string equal -nocase [lindex [split $temp] 0] $chan]} {
set exists 1
break
}
}
if {$exists} {
set z ""
set a [open $file r]
while {![eof $a]} {
set b [gets $a]
if {![string equal -nocase [lindex $b 0] $chan]} { lappend z ${b} }
}
close $a
set n [open $file w]
foreach k $z {
if {$k != ""} { puts $n $k }
}
close $n
putlog "Deleted $chan from file."
puthelp "MSG $setting(privechan) : $chan was deleted, the channel was not having enough users"
utimer 5 [list remove channel $chan]
utimer 7 [list savechannels]
} {
putlog "ERROR $chan not found in chanlist"
}
}
}
Error : Tcl error [global:check]: wrong # args: should be "llength list"
When i rewite the script and make it
Code: Select all
{[llength list [[chanlist $chan] < $setting(minusers)]]} {
it returns all the names off the users on that channel with the msg
Tcl error [global:check]: invalid command name, (and all the names)
So i guess this is not right, i tried a little more things butt then the code i complety messed up,
Can you guys give me some help ?