This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Write Channel list 2 File

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
crux
Voice
Posts: 35
Joined: Fri Jan 05, 2007 12:41 pm
Location: Myanmar
Contact:

Write Channel list 2 File

Post by crux »

Hello,
anyone can help to write channel list to .txt file, like that

Write Channel Nicklist 2 File tcl.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Re: Write Channel list 2 File

Post by Sir_Fz »

nyilad wrote:Hello,
anyone can help to write channel list to .txt file, like that

Write Channel Nicklist 2 File tcl.
Yeah, like Write Channel Nicklist 2 File.
User avatar
crux
Voice
Posts: 35
Joined: Fri Jan 05, 2007 12:41 pm
Location: Myanmar
Contact:

Post by crux »

hehe.. I mean all channels list to .txt file without topics ...
pls help me with tcl code.....
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Code: Select all

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"?
User avatar
crux
Voice
Posts: 35
Joined: Fri Jan 05, 2007 12:41 pm
Location: Myanmar
Contact:

Post by crux »

thanks you
User avatar
crux
Voice
Posts: 35
Joined: Fri Jan 05, 2007 12:41 pm
Location: Myanmar
Contact:

Post by crux »

I edit like that

Code: Select all

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..
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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"?
Post Reply