Comunidad @ TerraChat

IRCd => Eggdrops (TCL) => Códigos en Español => Mensaje iniciado por: TerraChat en Sep 26, 2023, 09:56 AM

Título: Limite Canal
Publicado por: TerraChat en Sep 26, 2023, 09:56 AM
bind time - "* * * * *" time:ChanLimit

proc time:ChanLimit {min hour day month year} {
    foreach chan [channels] {
    set newlimit [expr [llength [chanlist $chan]] + 10]
    set currentlimit [currentlimit $chan]
    if {$currentlimit < [expr $newlimit - 1] || $currentlimit > [expr $newlimit + 1]} {
        putserv "mode $chan +l $newlimit"
    }
    } 
}

proc currentlimit {chan} {
    set currentmodes [getchanmode $chan]
    if {[string match "*l*" [lindex $currentmodes 0]]} {
    return [lindex $currentmodes end]
    }
    return 0
}
putlog "=== Limite @ TerraChat ==="