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 

pauze code for xx secs

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


Joined: 01 Dec 2008
Posts: 6

PostPosted: Mon Dec 01, 2008 10:25 am    Post subject: pauze code for xx secs Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Dec 01, 2008 12:32 pm    Post subject: Reply with quote

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


Joined: 01 Dec 2008
Posts: 6

PostPosted: Mon Dec 01, 2008 2:23 pm    Post subject: Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Dec 01, 2008 9:04 pm    Post subject: Reply with quote

Pretty much, yeah
_________________
NML_375, idling at #eggdrop@IrcNET
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