| View previous topic :: View next topic |
| Author |
Message |
crux Voice

Joined: 05 Jan 2007 Posts: 35 Location: Myanmar
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
crux Voice

Joined: 05 Jan 2007 Posts: 35 Location: Myanmar
|
Posted: Mon Feb 12, 2007 11:22 am Post subject: |
|
|
hehe.. I mean all channels list to .txt file without topics ...
pls help me with tcl code..... _________________ Myanmar Chat Online
MCO Chat |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Mon Feb 12, 2007 11:41 am Post subject: |
|
|
| Code: | proc savechanlists file {
set f [open $file w]
foreach chan [channels] {
if {[botonchan $chan]} {
puts $f [join [chanlist $chan] \n]
}
}
close $f
} |
_________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
crux Voice

Joined: 05 Jan 2007 Posts: 35 Location: Myanmar
|
|
| Back to top |
|
 |
crux Voice

Joined: 05 Jan 2007 Posts: 35 Location: Myanmar
|
Posted: Mon Feb 12, 2007 5:06 pm Post subject: |
|
|
I edit like that
| Code: | set file "chanlist.txt"
if {![info exists chanlist_running]} {
timer 20 chanlist:make
set chanlist_running 1
}
proc chanlist:make {args} {
global file channel botnick
set chanlist [chanlist]
set chanlist [lsort -dictionary [lrange $chanlist 0 end]]
set outputfile [open $file w]
proc savechanlists file {
set f [open $file w]
foreach chan [channels] {
if {[botonchan $chan]} {
puts $f [join [chanlist $chan] \n]
}
}
close $f
}
close $outputfile
putlog "Saving channel list..."
timer 20 chanlist:make
return 1
}
putlog "Write Channel list to File." |
but my output file chanlist.txt size is 0 ...
please help me.. _________________ Myanmar Chat Online
MCO Chat |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Mon Feb 12, 2007 5:19 pm Post subject: |
|
|
In your proc, you open the file, create a proc then close the file - there are no lines writing anything to the file - that's why it's empty. _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
|