When i rejoin the channel, i get the following error message:
I want it to write to a text file, in the form of "Nick host1 host2 host3 etc".
With my basic knowledge of tcl, i thought one way to do this, was to set all the info in a a list, then write it. Any suggestions are welcome

Code: Select all
[00:18] Tcl error [join:hostcheck]: can not find channel named "file17"
Code: Select all
set hostfile "/home/asoaron/devbot/scripts/hosts/hosts.dat"
bind join - * join:hostcheck
proc join:hostcheck {nick host hand chan} {
global hostfile botnick
set found 0
set fs [open $hostfile r]
while {![eof $fs]} {
gets $fs line
if {[lrange $line 1 end] == $host} { set found 1 }
close $fs
}
if {$found} {
return 0
}
else {
if {[lindex $line 0] == $nick} {
set lijst [split $line]
set lijst2 [lappend $lijst $host]
set fs [open $hostfile w]
puts $fs "$lijst2"
close $fs
}
}
}
Thanks in advance.