chanlimit tcl

#~~~~~~~~~~~~~~~~~~~~~~~~~
# Kanal Giriş Limiti Ayarlanması
# Copyright © iRC Mirckeyfi.net 2009
#~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~
# Binds
#~~~~~~~~~~~~~~~~~~~~~~~~~~
bind time – “* * * * *” time:ChanLimit

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

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# time:ChanLimit end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# currentlimit start
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# currentlimit end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# putlog
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

putlog “Loaded ChanLimit – iRC”

相关文章:

中文关键字:

Etiketler: ,

Yorum yapın