cache wrote:Need help with bind time, trying to get the bot to say something every monday and thursday at 9am.
day is a zero padded two digit integer 01 through 31 representing day of the month.
Does this mean I need to make a proc for every month since the days aren't the same for each month? Like the 15th could be monday for one month then next month it could be tuesday. Not an issue if I have to, just wonder if there is a short way?
Thanks
How about using bind time to run a proc every day at 9:00, and within that proc check to see if today is Monday or Thursday?
Something like this:
Code: Select all
bind time - "* 09 * * *" time_demo
proc time_demo {min hour day month year} {
if {"[strftime %A]"=="Monday"} {
## commands to say what you want to say on Monday go here
}
if {"[strftime %A]"=="Thursday"} {
#commands to say what you want to say on Thursday go here
}
}
References:
http://www.baschny.de/eggdrop/faq/faq-f.html
and find the section on bind time
tcl-commands.doc for strftime command, and also:
http://linux.about.com/library/cmd/blcmdl3_strftime.htm
for a nice list of the formats.
I'm half asleep... I hope I got it right. With some quick testing, as best I could, ... it worked.
I hope this helps.