My suggestion would be to use bind time. A static timer for changing the topic at very specific times in a day. And you can declare a simple 2-3 line proc to call that bind and make it set the topic.
#This would be for 4 o'clock (pm - afternoon) if I am correct:
Code: Select all
#Set the channel where the bot should change the topic
set channel_name "#channelname"
#Set the topic for 4pm here
set 4oclock_topic "topic here... bla bla bla"
bind time - "00 16 * * *" 4oclock:topic
proc 4oclock:topic {min hour day month year} {
global channel_name 4oclock_topic
if {[botisop $channel_name] && ($4oclock_topic != "")} {
putquick "TOPIC $channel_name :$4oclock_topic" -next
}
}
The wildcard "*" means any day for day, any month for month and any year for the year field. You only have to change the minute and hour for the bind, keeping in mind they are used in a 24hr format, not in the 12hr format.
The rest can be just defined topics, either you can have 3 different procs for the 3 different times or include all in one. The simpler and easier one would be to make all individual.
TIME (stackable)
bind time <flags> <mask> <proc>
proc-name <minute> <hour> <day> <month> <year>
Description: allows you to schedule procedure calls at certain times. mask matches 5 space separated integers of the form: "minute hour day month year". minute, hour, day, month have a zero padding so they are exactly two characters long; year is extended to four characters in the same way. flags are ignored.
Else if you want the bot to switch the topic when a moderator switches his nick just use "bind nick".
Here is an example of when a moderator changes his nick
Code: Select all
#Set a common nick matching the moderator's nick - (wildcards are allowed)
#(Note: If you want to enter a precise nick, leave this as empty and try the setting below)
set matchnick1 "dj*"
#Set the exact moderator's nick - (nick should be precise, case is ignored)
#(Note: Only the above or this setting can be used)
set matchnick2 ""
#Set the topic here
set chantopic "bla bla bla......... my topic here"
bind nick - * badnick:change
proc badnick:change {nick uhost hand chan newnick} {
global botnick matchnick1 matchnick2 chantopic
if {([string equal -nocase $botnick $nick])} { return 0 }
if {($matchnick1 != "") && ([string match -nocase *$matchnick1* $newnick]} {
putquick "TOPIC $chan :$chantopic" -next
}
elseif {($matchnick2 != "") && ([string equal -nocase $matchnick2 $newnick]} {
putquick "TOPIC $chan :$chantopic" -next
}
}