strftime seems to be working great for the most part. Sometimes i have to restart the bot completely vs a .rehash but that may or may not be related to the code below, and more related to numerous mysql connections, not sure yet. But if anyone sees anything glaringly wrong w the below please let me know
the two instances im using for this are:
Code: Select all
if { [strftime %u] >= 1 && [strftime %u] <= 6 && [strftime %H%M] >= 930 && [strftime %H%M] <= 1700 &&
[scan $min %d] % 5 == 0} {
and
Code: Select all
if { [strftime %u] == 7 && [strftime %H] >= 18 && [scan $min %d] % 15 == 0 ||
[strftime %u] >= 1 && [strftime %u] <= 5 && [scan $min %d] % 15 == 0} {
also what nml375 posted that strftime %H before noon will report back "01" or "02" for example vs just "1" or "2". However if you try to evaluate:
if { [strftime %H] >= 08 }
the bot will error and say this looks like an octal number just as nml375 mentioned.
** and i just realized that the first block of code i posted was NOT running before 10am today so the times will HAVE to be evaluated in the manner that nml375 posted as tcl/eggdrop aparently does not view 01 to == 1
thats a good finding
but the cron method if probably the the best way to run this proc m-f and ill look at the times seperately as mentioned in his post for simplicity
the second block of code i posted works fine since it only evaluates the hour if its greater than 2 digits anyway. cron may not work for this because it needs to look at different times if its a sunday