| View previous topic :: View next topic |
| Author |
Message |
paull Voice
Joined: 01 Dec 2008 Posts: 6
|
Posted: Mon Dec 01, 2008 10:25 am Post subject: pauze code for xx secs |
|
|
I am looking for a code that will wait xx sec before it goes to th next part.
Past of my code:
| Code: |
putallbots "!channel $chan $nick"
(hold for xx secs)
set output [::mysql::sel $db "SELECT * FROM channel WHERE nick = '$nick' LIMIT 1;" -list]
if {[string equal $output ""] != 1} {
::mysql::close $db
return 0
}
|
The putallbots send the stuff to the other bots, then I want to code to hold for 2 secs before it goes on to the query part.
Anyone know how I can do this?
Thanks |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Dec 01, 2008 12:32 pm Post subject: |
|
|
I would recommend splitting this into two separate procs, calling the second one from the first using utimer. Any proc that "blocks" (delays) will block your whole eggdrop, preventing it from taking any further actions until your proc completes.
Keeping that in mind, you could use the after command to simply hold your script for a specified amount of time. I would still strongly advice against this in favour of using timers. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
paull Voice
Joined: 01 Dec 2008 Posts: 6
|
Posted: Mon Dec 01, 2008 2:23 pm Post subject: |
|
|
Good idea, thanks.
So the code will be something like(?):
| Code: |
putallbots "!channel $test1 $test2"
utimer 5 [list usetest $test1 $test2]
}
proc usetest {test1 test2} {
|
Thanks |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Dec 01, 2008 9:04 pm Post subject: |
|
|
Pretty much, yeah _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|