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 

about timer

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


Joined: 06 Nov 2006
Posts: 255

PostPosted: Mon Jul 30, 2007 1:16 pm    Post subject: about timer Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Jul 30, 2007 1:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Mon Jul 30, 2007 1:22 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Jul 30, 2007 4:01 pm    Post subject: Reply with quote

Timers (Searching, killing, using time binds).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Mon Aug 06, 2007 7:45 am    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Aug 06, 2007 11:43 am    Post subject: Reply with quote

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,
Code:
utimer 5 Delete
would cause your script to execute the command Delete after 5 seconds.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Tue Aug 07, 2007 1:47 pm    Post subject: Reply with quote

yes i want to run the proc DELETE always afte 5 minites like..


timer 5 DELETE

something like that?
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Aug 07, 2007 2:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Tue Aug 07, 2007 8:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Thu Aug 30, 2007 6:22 am    Post subject: Reply with quote

fixed thnx
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