stop posts on chan.
#8
Just a random thought there, but shouldn't it be [isop] rather than ![isop] o_o ?

Anyway - if i understood correctly what you want is simply a custom output queue ?
Here's a somewhat different approach than CC's. I tested it quickly with a bare tcl interp, it should work on eggdrops just as well :

Code :
set ::helpQueue {}
set ::helpQueueTimer {}
set ::helpQueueDelay 2500 ;# One message every 2500 ms

# Reset queue status
proc clearHelpQueue {args} {
    set ::helpQueue {}
    set ::helpQueueTimer [after cancel $::helpQueueTimer] }

proc processHelpQueue {args} {
    if {![llength $::helpQueue]} { return [clearHelpQueue] }
    # Pop first element from list and send it to server
    putquick [lindex $::helpQueue 0]
    if {[llength [set ::helpQueue [lrange $::helpQueue 1 end]]]} {
    # Init timer for next iteration if there's more to send, otherwise stop
        set ::helpQueueTimer [after $::helpQueueDelay ::processHelpQueue]
    } else { set ::helpQueueTimer {} }
}

proc pushHelpQueue {request} {
    # Push the message to the queue
    lappend ::helpQueue $request
    # Start it if not running
    if {$::helpQueueTimer == ""} { set ::helpQueueTimer [after $::helpQueueDelay ::processHelpQueue] }
}

You can bind !stop directly to clearHelpQueue, and then just use pushHelpQueue instead of puthelp/putquick in the script.
Répondre Avertir


Messages dans ce sujet
stop posts on chan. - par heartbroken - 18/11/2012, 10:44
RE: stop posts on chan. - par CrazyCat - 18/11/2012, 11:39
RE: stop posts on chan. - par heartbroken - 19/11/2012, 03:56
RE: stop posts on chan. - par heartbroken - 21/11/2012, 00:59
RE: stop posts on chan. - par CrazyCat - 21/11/2012, 15:17
RE: stop posts on chan. - par heartbroken - 21/11/2012, 17:44
RE: stop posts on chan. - par CrazyCat - 22/11/2012, 10:11
RE: stop posts on chan. - par Artix - 23/11/2012, 22:07

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté