egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

issue with "bind cron" on eggdrop 1.8

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Doktor J
Voice


Joined: 16 Oct 2012
Posts: 1

PostPosted: Tue Oct 16, 2012 11:13 am    Post subject: issue with "bind cron" on eggdrop 1.8 Reply with quote

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:
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:
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/1.6.20/tcl-commands.html#binda_cron shows the syntax as
Code:
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!
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Tue Oct 16, 2012 2:14 pm    Post subject: Re: issue with "bind cron" on eggdrop 1.8 Reply with quote

Check it out here:
http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html
and scroll down to
bind cron
Quote:

proc-name <minute> <hour> <day> <month> <weekday>


Looks like you are getting the weekday.


Quote:

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber