Code: Select all
set count(channels) "[list #channel1 #channel2 #channel3 #etc]"
set count(max) "5"
set count(modes) "+m"
bind mode -|- "% *+i*" count:mode
proc count:mode {nickname hostname handle channel mode target} {
global count
if {[lsearch -exact $count(channels) $channel] == -1} { return }
if {![isbotnick $nickname]} { return }
if {$mode == "+i"} {
if {![info exists count($channel)]} {
set count($channel) "1"
} else {
incr count($channel) 1
}
if {$count($channel) >= $count(max)} {
pushmode $channel $count(modes)
}
}
}
Code: Select all
# only in lowercase, so #channel1 and not #ChannEl1.
set count(channels) [list #channel1 #channel2 #channel3 #etc]
set count(max) 5
set count(modes) "+m"
bind mode -|- "% *+i*" count:mode
proc count:mode {nickname hostname handle channel mode target} {
global count
if {([lsearch -exact $count(channels) [string tolower $channel]] == -1) || ![isbotnick $nickname]} { return }
if {![info exists count($channel)]} {
set count($channel) 1
} else {
incr count($channel)
}
if {$count($channel) >= $count(max)} {
pushmode $channel $count(modes)
}
}
Code: Select all
setudef flag countmodes
setudef int maxcountmodes
setudef str docountmodes
bind mode -|- "% *+i*" count:mode
proc count:mode {nickname hostname handle channel mode target} {
global count
if {!([channel get $channel countmodes] && [isbotnick $nickname])} { return 0 }
set channel [string tolower $channel]
if {![info exists count($channel)]} {
set count($channel) 1
} else {
incr count($channel)
}
if {$count($channel) >= [channel get $channel maxcountmodes]} {
pushmode $channel [channel get $channel docountmodes]
}
}
Code: Select all
proc dcc:test {handle idx text } {......}
Code: Select all
proc count:mode {nickname hostname handle channel mode target} {
.......
if {$count($channel) >= $count(max)} {
dcc:test $handle $idx $text <---------- is this correct?
}
}
I dont think this script works, set up settings but still nothing happened and i was wondering if it can check max mode change in mints. ex: 3:5nml375 wrote:Chanset enabled version:Code: Select all
setudef flag countmodes setudef int maxcountmodes setudef str docountmodes bind mode -|- "% *+i*" count:mode proc count:mode {nickname hostname handle channel mode target} { global count if {!([channel get $channel countmodes] && [isbotnick $nickname])} { return 0 } set channel [string tolower $channel] if {![info exists count($channel)]} { set count($channel) 1 } else { incr count($channel) } if {$count($channel) >= [channel get $channel maxcountmodes]} { pushmode $channel [channel get $channel docountmodes] } }