| View previous topic :: View next topic |
| Author |
Message |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Thu May 03, 2007 7:26 am Post subject: bind time |
|
|
Hi, can anyone please explain to me in detail about bind time ****** ... I don't get it, if you can give me a tutorial link or something liek that I will really appreciate that. Thanks. _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Thu May 03, 2007 9:46 am Post subject: |
|
|
www.google.com _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu May 03, 2007 10:10 am Post subject: |
|
|
| doc/tcl-commands.doc wrote: | (37) TIME (stackable)
bind time <flags> <mask> <proc>
proc-name <minute> <hour> <day> <month> <year>
Description: allows you to schedule procedure calls at certain
times. mask matches 5 space separated integers of the form:
"minute hour day month year". minute, hour, day, month have a
zero padding so they are exactly two characters long; year is
four characters. Flags are ignored.
Module: core
|
Simply put, upon every HOOK_MINUTELY (every minute), a string is created such as this "<minute> <hour> <day> <month> <year>" (the same string could be generated using [clock format -format "%M %H %d %m %Y" [clock seconds]]). This is then matched against all time-bindings you've created (in a similar fashion to "string match", thus allowing wildcards such as *), and if it matches, the associated code is executed.
The mask "*" would match any time (and thus trigger every minute).
The mask "00 *" would match whenever the minute-part is 00 (triggers every hour on the hour).
The mask "* 01 *" would match whenever the hour, day, or month is 01 (or any combination of those) - probably not useful, and most scripters were probably intending a completely different result. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu May 03, 2007 2:31 pm Post subject: |
|
|
This should also be useful (from Tcl-commands.doc):
| Quote: | *** MATCH CHARACTERS ***
Many of the bindings allow match characters in the arguments. Here
are the four special characters:
? matches any single character
* matches 0 or more characters of any type
% matches 0 or more non-space characters (can be used to match a single
word)
~ matches 1 or more space characters (can be used for whitespace between
words) |
These match-characters can be used in the <mask> of binds (which accept wild cards). _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Thu May 03, 2007 3:59 pm Post subject: |
|
|
Thanks alot that was really useful, i'll use it in a script and let you know if there is any problem I am facing.
Thanks  _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Thu May 03, 2007 5:07 pm Post subject: |
|
|
Worth noting: the first month is 00, while the first day is 01 (and there's no mention of that in the docs) _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
|