I got that to work, but now i got another problem..
Code: Select all
proc list_bchannels {userfile-loaded} {
global "bitchchannels"
set datafile bitchchannels
if {![file exists bitchchannels]} {
set r [open bitchchannels a+]
puts $r "."
putlog "File bitchchannels missing, created it."
catch {open $datafile r} rf
foreach {a b c} [split [read $rf] \n] {
close $rf
set:sbch $datafile $datafile $a
} else {
if {![catch {open $datafile r} rf]} {
foreach {a b c} [split [read $rf] \n] {
putlog "Added channels: $a."
set:sbch $datafile $datafile $a
}
close $rf
} else {
putlog "Couldn't open $datafile for reading."
}
}
}
}
it creat the file "bitchchannels", then it put a "." in it if it dosent exist, thats ok, the file cant be empty since the bot reading from it and sets a var from the file, but it dosent go on after } else { . it halts there, and if the file dosent exist, then it should create it then trigger set:sbch $datafile $datafile $a, if the file exist it should read from it, then trigger the command "set:sbch $datafile $datafile $a", what cosing it to halt ? i have +d in console, i also have been looking with .tcl set errorInfo , and i get no info about what cosing the problem, all i get is that the var it should set is missing, thats cos the command never get triggered.. how do i solve this ?