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.

Get topic from file.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
shnt
Voice
Posts: 3
Joined: Thu Nov 15, 2007 3:44 am

Get topic from file.

Post by shnt »

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

Post by user »

This should update the topic every hour:

Code: Select all

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