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.

issue with "bind cron" on eggdrop 1.8

Help for those learning Tcl or writing their own scripts.
Post Reply
D
Doktor J
Voice
Posts: 1
Joined: Tue Oct 16, 2012 10:16 am

issue with "bind cron" on eggdrop 1.8

Post by Doktor J »

Hi, I'm running eggdrop v1.8.0+stripmoar, and all has been going well for me... until I decided to make a cron bind.

The bind itself seems to work fine:

Code: Select all

bind cron - {* * * * *} brick:cron
(Yes, I want it running every minute; it will be doing various things based on various combinations of time and day)

However, the proc is giving me weird results. My test proc looks like so:

Code: Select all

proc brick:cron {min hr day mo yr} {
  putlog "${hr}:${min} ${mo}.${day} ${yr}"
}
but the output is like so:
10:33 10.16 02

Why is the year showing up as "02"? My server's date command returns "Tue Oct 16 10:33:42 EDT 2012", so that's definitely not the year (unless it's giving me only the century portion, reversed o_O).

What makes this more confusing is that the documentation I found at http://www.eggheads.org/support/egghtml ... binda_cron shows the syntax as

Code: Select all

proc-name <minute> <hour> <day> <weekday> <year>
but "10" obviously isn't a weekday, and looks like the month instead... and "02" doesn't appear to be the year. Is it calling the proc with {minute hour day month weekday} or something screwy like that? How would I get the year then?

Thanks!
w
willyw
Revered One
Posts: 1209
Joined: Thu Jan 15, 2009 12:55 am

Re: issue with "bind cron" on eggdrop 1.8

Post by willyw »

Check it out here:
http://www.eggheads.org/support/egghtml ... mands.html
and scroll down to
bind cron
proc-name <minute> <hour> <day> <month> <weekday>
Looks like you are getting the weekday.

How would I get the year then?
On that tcl-commands page, find
strftime

Then check out:
http://linux.about.com/library/cmd/blcmdl3_strftime.htm
for the command syntax.

How about this:
strftime %Y


I hope this helps.
Post Reply