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 

Get topic from file.

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


Joined: 15 Nov 2007
Posts: 3

PostPosted: Thu Nov 15, 2007 5:35 am    Post subject: Get topic from file. Reply with quote

I need to get one string from file every 60-120 minutes and if it is not empty, then set it as topic on #channel. My file will always contain only one dynamic string with fixed lenght (or +- 2 chars).

Can anyone help me with such script?
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Thu Nov 15, 2007 7:32 am    Post subject: Reply with quote

This should update the topic every hour:
Code:
bind time - 00* updateTopic
proc updateTopic args {
   set f [open yourtopicfile.txt]
   set topic [gets $f]
   close $f
   if {$topic!=""} {
      puthelp "TOPIC #yourchan :$topic"
   }
}

(Not tested. (Remember to change "yourtopicfile.txt" and "#yourchan" to suit your needs))
_________________
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