Code: Select all
#just add to a file and load it as any other tcl script
#set this to the number of chatters before toggle
set togglechatters 2
bind part - * check:numbers:part
bind sign - * check:numbers:part
proc check:numbers {nick host hand chan arg} {
resetchan $chan
if {[llength [chanlist $chan]] == 1} {
pushmode $chan "+s"
}
}
bind join - * check:numbers:join
proc check:numbers:join {nick host hand chan arg} {
resetchan $chan
if {[llength [chanlist $chan]] >= $::togglechatters && [string match "s" [lindex [split [getchanmode $chan]] 0]]} {
pushmode $chan "-s"
}
}
Code: Select all
if {[llength [chanlist $chan]] >= $::togglechatters && [string match "*s*" [lindex [split [getchanmode $chan]] 0]]} {
Code: Select all
proc check:numbers {nick host hand chan arg} {
Code: Select all
proc check:numbers:part {nick host hand chan arg} {
Code: Select all
#just add to a file and load it as any other tcl script
#set this to the number of chatters before toggle
set togglechatters 2
bind part - * check:numbers:part
bind sign - * check:numbers:part
proc check:numbers:part {nick host hand chan arg} {
resetchan $chan
utimer 2 [list dothecheck $chan 1]
}
proc dothecheck {a b} {
switch $b {
{1} {
if {[llength [chanlist $a]] == 1} {
pushmode $a "+s"
}
{2} {
if {[llength [chanlist $a]] >= $::togglechatters && [string match "s" [lindex [split [getchanmode $a]] 0]]} {
pushmode $a "-s"
}
}
}
bind join - * check:numbers:join
proc check:numbers:join {nick host hand chan arg} {
resetchan $chan
utimer 2 [list dothecheck $chan 2]
}
Code: Select all
proc dothecheck {a b} {
switch $b {
{1} {
if {[llength [chanlist $a]] == 1} {
pushmode $a "+s"
}
}
{2} {
if {[llength [chanlist $a]] >= $::togglechatters && [string match "s" [lindex [split [getchanmode $a]] 0]]} {
pushmode $a "-s"
}
}
}
}
Code: Select all
set s_threshold 1
bind join - * do_the_s_check
bind part - * do_the_s_check
bind sign - * do_the_s_check
bind splt - * do_the_s_check
proc do_the_s_check {nick uhost hand chan args} {
if {[isbotnick $nick]} {
utimer 5 [list do_the_s_check . . . $chan]
} elseif {[validchan $chan]&&[botisop $chan]} {
if {[llength [chanlist $chan]]>$::s_threshold} {
if {[string match *s* [lindex [getchanmode $chan] 0]]]} {
pushmode $chan -s
}
} elseif {![string match *s* [lindex [getchanmode $chan] 0]]]} {
pushmode $chan +s
}
}
}