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.

bind time

Old posts that have not been replied to for several years.
Locked
m
makam
Voice
Posts: 15
Joined: Thu Jul 08, 2004 1:16 am
Location: Montevideo, Uruguay
Contact:

bind time

Post by makam »

Why this code dont ejecute?

bind time - "10 * * * *" mi_proc

proc mi_proc {min hour d month year} {
putlog "This is an example..."
}



...ugh?
--
Web: http://www.makam.org/
Chans: #Uruguay,#Hattricklatino@UnderNet
m
makam
Voice
Posts: 15
Joined: Thu Jul 08, 2004 1:16 am
Location: Montevideo, Uruguay
Contact:

Post by makam »

well, this code may be ejecute each 10 minutes, right?
--
Web: http://www.makam.org/
Chans: #Uruguay,#Hattricklatino@UnderNet
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

makam wrote:well, this code may be ejecute each 10 minutes, right?
"10 *" means ten minutes past every hour, try "?0 *" instead :)
Have you ever read "The Manual"?
m
makam
Voice
Posts: 15
Joined: Thu Jul 08, 2004 1:16 am
Location: Montevideo, Uruguay
Contact:

Post by makam »

if i want each 2 minutes?

"?2 * * * *"

is it ok? :roll:


Thx...
--
Web: http://www.makam.org/
Chans: #Uruguay,#Hattricklatino@UnderNet
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Nope..that's 2 minutes past every ten minutes. How about reading tcl-commands.doc? The mask is matched against the current time each minute.
There's no way to match every 2 minutes with a single mask. (you need five: "?0 *", "?2 *", "?4 *", "?6 *" and "?8 *")
It would probably be better to do the interval check from inside the proc and just bind to "*" (every minute)

Code: Select all

bind time - * mi_proc
proc mi_proc args {
	set interval 2;# minutes
	if {(([clock sec]/60)%$interval)==0} {
		putlog "This is an example..."
	}
}
Have you ever read "The Manual"?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

hmm how come this works clock sec ?? from what i recall its only "scan seconds format clicks" just wondering not trying to correct u ;)
XplaiN but think of me as stupid
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Ofloo wrote:hmm how come this works clock sec ?? from what i recall its only "scan seconds format clicks" just wondering not trying to correct u ;)
From the 'clock' manual page:
... The legal options (which may be abbreviated) are: ...
http://forum.egghelp.org/viewtopic.php?t=4444#20546
Have you ever read "The Manual"?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

hmm i think i understand now .. tnx
XplaiN but think of me as stupid
Locked