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. 
	 
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
			
		
				
			- 
				
								crux							
- Voice
- Posts: 35
- Joined: Fri Jan 05, 2007 12:41 pm
- Location: Myanmar
- 
				Contact:
				
			
						
					
													
							
						
									
						Post
					
								by crux » 
			
			
			
			
			
			Hello,
anyone  can help to write channel list to .txt file, like that 
Write Channel Nicklist 2 File tcl.
 
		 
				
		
		 
	 
				
		
				
			- 
				
								Sir_Fz							
- Revered One
- Posts: 3794
- Joined: Sun Apr 27, 2003 3:10 pm
- Location: Lebanon
- 
				Contact:
				
			
						
					
													
							
						
									
						Post
					
								by Sir_Fz » 
			
			
			
			
			
			
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
				
			- 
				
								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							
-  
- 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"?
			
						 
		 
				
		
		 
	 
				
		
				
			- 
				
								crux							
- Voice
- Posts: 35
- Joined: Fri Jan 05, 2007 12:41 pm
- Location: Myanmar
- 
				Contact:
				
			
						
					
						
		
													
							
						
									
						Post
					
								by crux » 
			
			
			
			
			
			thanks you
			
			
									
						
										
						 
		 
				
		
		 
	 
				
		
				
			- 
				
								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							
-  
- 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"?