############################################################################## # FloatLimit.tcl (Fixed Version) # Maintains +l (Users + 1) across ALL channels where the bot is Opped. ############################################################################## namespace eval FloatLimit { variable join_delay 30 variable sync_delay 500 bind join - * [namespace current]::trigger_join bind part - * [namespace current]::trigger_sync bind kick - * [namespace current]::trigger_kick bind sign - * [namespace current]::trigger_quit proc trigger_join {nick uhost hand chan} { variable join_delay foreach t [utimers] { if {[string match "*update_limit $chan*" [lindex $t 1]]} { killutimer [lindex $t 2] } } utimer $join_delay [list [namespace current]::update_limit $chan] } proc trigger_sync {nick uhost hand chan {arg ""}} { variable sync_delay after $sync_delay [list [namespace current]::update_limit $chan] } proc trigger_kick {nick uhost hand chan target reason} { trigger_sync $nick $uhost $hand $chan } proc trigger_quit {nick uhost hand chan reason} { trigger_sync $nick $uhost $hand $chan } proc update_limit {chan} { if {![validchan $chan] || ![botisop $chan]} { return } set user_count [llength [chanlist $chan]] set new_limit [expr {$user_count + 1}] set current_modes [getchanmode $chan] if {[regexp {l (\d+)} $current_modes -> old_limit]} { if {$old_limit == $new_limit} { return } } putserv "MODE $chan +l $new_limit" } } putlog "FloatLimit.tcl (Tight) loaded: Monitoring all Opped channels, by dracorex."