I'm not sure the right syntax for writeing to a file from within the dcc partyline. I was thinking of something like this.
bind dcc n .dbadd dcc_dbadd
proc dcc_dbadd {idx handle uhost input} {
set file [open "$file" a]
puts $file "info in text"
close $file
}
}
I'm really not sure if this is even close to the right syntax, I'm not that good with tcl, but I'm learning as i go. Thanks in advance for any help you give me
bind dcc - .dbadd dcc_dbadd
proc dcc_dbadd {idx uhost hand text dest} {
putdcc "\002New info added to the FAQ database by $nick\002"
set file "~/.faq"
set fs [open $file a+]
puts $fs "$text"
close #fs
}
now when i try to do .dbadd, it get What? you need .help.
I'm guessing maybe "uhost" shouldn't be there, but then again i'm not very good at this stuff =/.
SmokeyOne wrote:now that I think about it, how would i set it to go to the end of file and write the text?
read what he said ceasar... set file [open "$file" w] will not add text to the end of the file, it will overwrite the whole file, set file [open "$file" a] is the right syntax if you want to add text to the end of the file
Oh. Seems that I've skiped an line.. I was sleepy when I typed the answer sorry.. anyway, seems that the second answer is good At least that I can do..
Once the game is over, the king and the pawn go back in the same box.
you want a honest answer ? i forgot lol, sorry about that.I'll look though it, but only to get lost again =/
Well that and I was too tired to even try to read the screen anymore, knowing what the error is now I'm sure i forgot to define $text that i is why its giveing me that error.
okay I read it, but i guess its not helping, I'm still getting the tcl error for $text though I thought I already defind it. am I missing a "catch" statment here or something ?
nevermind, I think I'm about blind as a bat, but that's okay. After sleeping for awhile and comming back to it I got it hehe even found my little bug close #fs should have been close $fs.