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 

delay output

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


Joined: 21 May 2006
Posts: 103

PostPosted: Thu Sep 20, 2007 9:50 pm    Post subject: delay output Reply with quote

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


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Thu Sep 20, 2007 10:32 pm    Post subject: Re: delay output Reply with quote

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
View user's profile Send private message Send e-mail
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Thu Sep 20, 2007 10:50 pm    Post subject: Reply with quote

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 Very Happy
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Fri Sep 21, 2007 1:35 am    Post subject: Reply with quote

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


Joined: 13 Feb 2003
Posts: 939
Location: Redwood Coast

PostPosted: Fri Sep 21, 2007 2:33 am    Post subject: Re: delay output Reply with quote

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.
_________________
Mr. Green
Johoho's TCL for beginners
Mr. Green
Back to top
View user's profile Send private message Send e-mail
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Fri Sep 21, 2007 2:55 am    Post subject: Reply with quote

sorry, type'o Rolling Eyes *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
View user's profile Send private message Send e-mail
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Sep 21, 2007 9:05 am    Post subject: Reply with quote

TCL_no_TK wrote:
sorry, type'o Rolling Eyes *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
View user's profile Send private message Visit poster's website
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