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

Joined: 06 Nov 2006 Posts: 255
|
Posted: Mon Jul 30, 2007 1:16 pm Post subject: about timer |
|
|
hello .. how i can put timer command on tcl script.. i want every 5 minites to run one variable.. etc..
| Code: | proc test
timer 5 timer ? |
how i can do this?
thanks you |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Jul 30, 2007 1:20 pm Post subject: |
|
|
Either use a time-binding, or make a call to the timer command from within your proc. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Mon Jul 30, 2007 1:22 pm Post subject: |
|
|
Either use bind time:
| Code: | bind time {?0 * * * *} myproc
bind time {?5 * * * *} myproc
proc myproc {min hour day month year} {
# do my stuff here
}
|
Or just keep setting a timer:
| Code: | timer 5 [list myproc ?proc arguments?]
proc myproc {?proc arguments?} {
# do my stuff here
timer 5 [list myproc ?proc arguments?]
} |
Hope this helps! _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Mon Aug 06, 2007 7:45 am Post subject: |
|
|
because i am confused..
i want after 5 minites one proc run..
#procname : Delete
proc Delete
............
.....
utimer 5 Delete.. (and after 5 minites "Delete" is running)
something like that.. ? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Aug 06, 2007 11:43 am Post subject: |
|
|
timer and utimer delays the execution of a command by the time you specify (timer delays n minutes, while utimer delays n seconds).
Neither timer or utimer will repeat the command, bur simply execute it once after the specified delay, and they do not block execution of code while "counting down".
In your case, would cause your script to execute the command Delete after 5 seconds. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Tue Aug 07, 2007 1:47 pm Post subject: |
|
|
yes i want to run the proc DELETE always afte 5 minites like..
timer 5 DELETE
something like that? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Aug 07, 2007 2:38 pm Post subject: |
|
|
nml375 already made it clear that a timer will call the procedure only ONCE after n minutes. It is up to you to call the timer again inside your procedure each time it's called. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Tue Aug 07, 2007 8:15 pm Post subject: |
|
|
| ultralord wrote: | yes i want to run the proc DELETE always afte 5 minites like..
timer 5 DELETE
something like that? |
Then you need something like this:
| Code: |
timer 5 [list delete $args]
proc delete {args} {
#do your stuff here
###
#call timer to repeat execution
timer 5 [list delete $args]
}
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Thu Aug 30, 2007 6:22 am Post subject: |
|
|
| fixed thnx |
|
| Back to top |
|
 |
|