egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Write Channel list 2 File

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
crux
Voice


Joined: 05 Jan 2007
Posts: 35
Location: Myanmar

PostPosted: Wed Feb 07, 2007 6:28 pm    Post subject: Write Channel list 2 File Reply with quote

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

Write Channel Nicklist 2 File tcl.
_________________
Myanmar Chat Online
MCO Chat
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Feb 07, 2007 7:54 pm    Post subject: Re: Write Channel list 2 File Reply with quote

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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
crux
Voice


Joined: 05 Jan 2007
Posts: 35
Location: Myanmar

PostPosted: Mon Feb 12, 2007 11:22 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Mon Feb 12, 2007 11:41 am    Post subject: Reply with quote

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
View user's profile Send private message
crux
Voice


Joined: 05 Jan 2007
Posts: 35
Location: Myanmar

PostPosted: Mon Feb 12, 2007 3:14 pm    Post subject: Reply with quote

thanks you
_________________
Myanmar Chat Online
MCO Chat
Back to top
View user's profile Send private message Visit poster's website
crux
Voice


Joined: 05 Jan 2007
Posts: 35
Location: Myanmar

PostPosted: Mon Feb 12, 2007 5:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Mon Feb 12, 2007 5:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber