| View previous topic :: View next topic |
| Author |
Message |
c0re Voice
Joined: 18 Jan 2009 Posts: 16
|
Posted: Tue Apr 20, 2010 5:53 pm Post subject: blind time. |
|
|
Hi, i want to blind time every 4 sec. how do i do it?
bind time -|- {* * * * *} proc_update
i dont how to set second. please help |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Apr 20, 2010 6:09 pm Post subject: |
|
|
The time binding's resolution is down to the minute, so you cannot use that for anything shorter. The most common approach is to use recursive utimer calls:
| Code: | proc someproc {} {
#payload here...
#now for the recursive calling:
#First check for existing timers...
if {[lsearch [utimers] "* someproc *"] == -1} {
#No timers left, start a new one
utimer 4 [list someproc]
}
}
someproc |
This is a rough skeleton, with a few shortcuts. The check for running timers could probably be prettier, but should do the trick as long as you don't use very complex proc-names.. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
c0re Voice
Joined: 18 Jan 2009 Posts: 16
|
Posted: Wed Apr 21, 2010 3:39 am Post subject: |
|
|
Thank you for your quick reply.....
| Code: |
proc livefeed {} {
set pagina "my url"
set http [http::config -useragent mozilla]
set http [http::geturl $pagina -timeout [expr 1000 * 10]]
set html [http::data $http]
foreach line [split $html "\n"] {
putlog "upgrading livefeed."
if {[lsearch [utimers] "* livefeed *"] == -1} {
#No timers left, start a new one
utimer 5 [list livefeed]
}
} |
question is how do i bind it? with timer or something? |
|
| Back to top |
|
 |
c0re Voice
Joined: 18 Jan 2009 Posts: 16
|
Posted: Wed Apr 21, 2010 3:45 am Post subject: |
|
|
i figured it out and its work just great.....
| Code: | proc livefeed {} {
set pagina "my url"
set http [http::config -useragent mozilla]
set http [http::geturl $pagina -timeout [expr 1000 * 10]]
set html [http::data $http]
putlog "upgrading livefeed."
if {[lsearch [utimers] "* livefeed *"] == -1} {
#No timers left, start a new one
utimer 8 [list livefeed]
}
}
livefeed
|
Thank you so much.... |
|
| Back to top |
|
 |
|