View previous topic :: View next topic |
Author |
Message |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Thu Sep 20, 2007 9:50 pm Post subject: delay output |
|
|
Hi yall
I am trying to delay the time between putserv lines, eg
line 1
(wait ten seconds)
line 2
(wait another ten sections)
line 3
see what I mean?
Is there a way to do this - cheers |
|
Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Thu Sep 20, 2007 10:32 pm Post subject: Re: delay output |
|
|
There is a few. puthelp which will only send 1 line at a time, you could also looking into using timer or even time if you wanted to do it in minuets. timer uses seconds, so you could do after each line [expr lineNumber +1] Code: | timer [expr lineNumber +1] putserv "privmsg $channel :hello world!" | check the docs @ http://eggheads.org/support/egghtml/1.6.18/tcl-commands.html. _________________ TCL the misunderstood |
|
Back to top |
|
 |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Thu Sep 20, 2007 10:50 pm Post subject: |
|
|
thanks for the info here is what i am actually using the real proc i mean - cos i am not sure how to use your suggested code. I was looking for timer as I need the time delay to be say 10 - 15 seconds
Code: |
proc pub:send_nfo {nick host hand chan text} {
putlog 1
global mysql
set output [mysqlsel $mysql "SELECT * FROM nfo_cache WHERE status = '0'" -list]
putlog 2
foreach row $output {
putlog 3
set site [lindex $row 1]
putlog 4
set section [lindex $row 2]
putlog 5
set rls [lindex $row 3]
putlog 6
putquick "PRIVMSG #pre.nfo-feed :!fetch_nfo $site $section $rls"
putlog 7
mysqlexec $mysql "UPDATE nfo_cache SET status = '1'"
}
}
|
please ignore the putlog lines for debugging  |
|
Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Fri Sep 21, 2007 1:35 am Post subject: |
|
|
You can create your own delayed queues here with this script. Download it from:
http://barkerjr.net/pub/irc/eggdrop/Scripting/scripts/queues.tcl.tar.bz2 _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
Back to top |
|
 |
YooHoo Owner

Joined: 13 Feb 2003 Posts: 939 Location: Redwood Coast
|
Posted: Fri Sep 21, 2007 2:33 am Post subject: Re: delay output |
|
|
TCL_no_TK wrote: | There is a few. puthelp which will only send 1 line at a time, you could also looking into using timer or even time if you wanted to do it in minuets. timer uses seconds, so you could do after each line [expr lineNumber +1] Code: | timer [expr lineNumber +1] putserv "privmsg $channel :hello world!" | check the docs @ http://eggheads.org/support/egghtml/1.6.18/tcl-commands.html. | utimer uses seconds, timer uses minutes. _________________
Johoho's TCL for beginners
 |
|
Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Fri Sep 21, 2007 2:55 am Post subject: |
|
|
sorry, type'o *utimer.
Try this: Code: | proc pub:send_nfo {nick host hand chan text} {
global mysql
set output [mysqlsel $mysql "SELECT * FROM nfo_cache WHERE status = '0'" -list]
set c 10
foreach row $output {
set c [expr $c +5]
utimer $c putserv "PRIVMSG #pre.nfo-feed :!fetch_nfo [lindex $row 0] [lindex $row 1] [lindex $row 2]"
}; mysqlexec $mysql "UPDATE nfo_cache SET status = '1'"
} | Also try using Code: | set site [lindex $row 0]
set section [lindex $row 1]
set rls [lindex $row 2] | That should send the data to the channel every 10,15,20,25,30 mins ...etc
P.S i dont know the first thing about mysql, n stuff but as i haven't changed anything other than the lindex(s); it shouldn't affect anything mysql related. _________________ TCL the misunderstood |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Sep 21, 2007 9:05 am Post subject: |
|
|
TCL_no_TK wrote: | sorry, type'o *utimer.
Try this: Code: | proc pub:send_nfo {nick host hand chan text} {
global mysql
set output [mysqlsel $mysql "SELECT * FROM nfo_cache WHERE status = '0'" -list]
set c 10
foreach row $output {
set c [expr $c +5]
utimer $c putserv "PRIVMSG #pre.nfo-feed :!fetch_nfo [lindex $row 0] [lindex $row 1] [lindex $row 2]"
}; mysqlexec $mysql "UPDATE nfo_cache SET status = '1'"
} | Also try using Code: | set site [lindex $row 0]
set section [lindex $row 1]
set rls [lindex $row 2] | That should send the data to the channel every 10,15,20,25,30 mins ...etc
P.S i dont know the first thing about mysql, n stuff but as i haven't changed anything other than the lindex(s); it shouldn't affect anything mysql related. |
You're incorrectly using the [utimer] command.
Code: | utimer $c [list putserv "PRIVMSG #pre.nfo-feed :!fetch_nfo [lindex $row 0] [lindex $row 1] [lindex $row 2]"] |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
|