I am trying to buffer some text to be written to a file, so it only writes one line every 2 seconds. I cant seem to get it to wait untill the first utimer is done before it executes the next. So far, i just seem to stack a bunch of timers.
Code: Select all
proc log:chat {nick host hand chan text} {
global sub_dir
global chat_sets
global sub_file
set sub_str "<$nick> $text"
set sub_pointer [open $logdir/$sub_file w]
utimer 2 [puts $sub_pointer "$chat_sets"]
puts $sub_pointer "$sub_str"
close $sub_pointer
}