Code: Select all
ON *:text:*:#: {
 set -u5 % [ $+ [ $chan ] $+ . $+ [ $address($nick,2) ] $+ ] .partmsg on 
}
ON *:action:*:#: {
 set -u5 % [ $+ [ $chan ] $+ . $+ [ $address($nick,2) ] $+ ] .partmsg on 
}
On *:Part:#:{
  if (% [ $+ [ $chan ] $+ . $+ [ $address($nick,2) ] $+ ] .partmsg == on) {
     mode $chan  +b  $address($nick,2) 
    unset % [ $+ [ $chan ] $+ . $+ [ $address($nick,2) ] $+ ] .partmsg
  } 
}
ON !^*:QUIT: {
  var %cntz34 = 1
  while ($comchan($nick,%cntz34) != $null )  {
    var %floodchan $ifmatch
    if (% [ $+ [ %floodchan ] $+ . $+ [ $address($nick,2) ] $+ ] .partmsg == on) { 
      mode  %floodchan +b $address($nick,2) 
      unset % [ $+ [ %floodchan ] $+ . $+ [ $address($nick,2) ] $+ ] .partmsg
    }
    inc %cntz34
    halt
  }
}Code: Select all
bind PUB - * pub:spam
bind CTCP - ACTION ctcp:spam
bind PART - * part:spam
bind SIGN - * sign:spam
proc pub:spam {nick uhost hand chan txt} {
	global spamlist
	set spamlist($chan,$nick) [unixtime]
}
proc ctcp:spam {nick uhost hand chan key txt} {
	global spamlist
	set spamlist($chan,$nick) [unixtime]
}
proc part:spam {nick uhost hand chan {txt ""}} {
	global spamlist
	if {$spamlist($chan,$nick) != ""} {
		if {[expr {[unixtime] - $spamlist($chan,$nick)}] < 6} {  
			pushmode $chan +b [maskhost "$nick!$uhost" 3]
		}
	}
}
proc sign:spam {nick uhost hand chan txt} {
	global spamlist
	if {$spamlist($chan,$nick) != ""} {
		if {[expr {[unixtime] - $spamlist($chan,$nick)}] < 6} { 
			foreach spamchan [channel] {
				pushmode $spamchan +b [maskhost "$nick!$uhost" 3]
			}
		}
	}
}
20:43:44 <TCL-Tester> [20:44:18] Tcl error [sign:spam]: can't read "spamlist(#opers,Leake)": no such variable
20:43:44 <TCL-Tester> [20:44:18] Tcl error [sign:spam]: can't read "spamlist(#opers,Toshia)": no such variable
20:43:44 <TCL-Tester> [20:44:18] Tcl error [sign:spam]: can't read "spamlist(#opers,Millard)": no such variable
20:43:44 <TCL-Tester> [20:44:18] Tcl error [sign:spam]: can't read "spamlist(#opers,Mchugh)": no such variable
20:43:44 <TCL-Tester> [20:44:18] Tcl error [sign:spam]: can't read "spamlist(#opers,Cota)": no such variable
20:43:44 <TCL-Tester> [20:44:18] Tcl error [sign:spam]: can't read "spamlist(#opers,Krauss)": no such variable
Code: Select all
bind PUBM - * pub:spam
bind CTCP - ACTION ctcp:spam
bind PART - * part:spam
bind SIGN - * sign:spam
array set spamlist {}  
proc pub:spam {nick uhost hand chan txt} {
	global spamlist
	set ::spamlist($chan,$nick) [unixtime]
}
proc ctcp:spam {nick uhost hand chan key txt} {
	global spamlist
	set ::spamlist($chan,$nick) [unixtime]	
}
proc part:spam {nick uhost hand chan {txt ""}} {
	global spamlist
	if {$spamlist($chan,$nick) != ""} {
		if {[expr {[unixtime] - $spamlist($chan,$nick)}] < 6} {  
			pushmode $chan +b [maskhost "$nick!$uhost" 3]
		}
	}
}
proc sign:spam {nick uhost hand chan txt} {
	global spamlist
	if {$spamlist($chan,$nick)] != ""} {
		if {[expr {[unixtime] - $spamlist($chan,$nick)}] < 6} { 
			foreach spamchan [channel] {
				pushmode $spamchan +b [maskhost "$nick!$uhost" 3]
			}
		}
	}
}Code: Select all
set ::spamlist($chan,$nick) [unixtime] 
Code: Select all
lappend spamlist($chan) [list $nick [clock seconds]]
Code: Select all
if {$spamlist($chan,$nick) != ""} {
      if {[expr {[unixtime] - $spamlist($chan,$nick)}] < 6} { 
         pushmode $chan +b [maskhost "$nick!$uhost" 3]
      }
   } 
Code: Select all
if {![info exists spamlist($chan)]} return
set pos [lsearch -nocase [dict keys [join $spamlist($chan)]] $nick]
if {$pos > -1} {
	scan [lindex $spamlist($chan) $pos] {%s%s} user time
	set now [clock seconds]
	if {[expr $now - $time] < 6} {
		pushmode $chan +b [maskhost "$nick!$uhost" 3]
		set spamlist($chan) [lreplace $spamlist($chan) $pos $pos]
	}
}
Code: Select all
if {$spamlist($chan,$nick)] != ""} {
      if {[expr {[unixtime] - $spamlist($chan,$nick)}] < 6} {
         foreach spamchan [channel] {
            pushmode $spamchan +b [maskhost "$nick!$uhost" 3]
         }
      }
   } 
Code: Select all
if {![info exists spamlist($chan)]} return
set pos [lsearch -nocase [dict keys [join $spamlist($chan)]] $nick]
if {$pos > -1} {
	scan [lindex $spamlist($chan) $pos] {%s%s} user time
	set now [clock seconds]
	if {[expr $now - $time] < 6} {
		set spamlist($chan) [lreplace $spamlist($chan) $pos $pos]
		set mask [maskhost "$nick!$uhost" 3]
		foreach c [channels] {
			pushmode $c +b $mask
		}
	}
}
Code: Select all
proc part:spam {nick uhost hand chan {txt ""}} {
   ban:spam $nick $uhost $chan
}
proc sign:spam {nick uhost hand chan txt} {
   ban:spam $nick $uhost $chan
}
proc ban:spam {nick uhost chan} {
   if {![info exists ::spamlist($chan)]} return
   set pos [lsearch -nocase [dict keys [join $::spamlist($chan)]] $nick]
   if {$pos > -1} {
      scan [lindex $::spamlist($chan) $pos] {%s%s} user time
      set now [clock seconds]
      if {[expr $now - $time] < 6} {
         set ::spamlist($chan) [lreplace $::spamlist($chan) $pos $pos]
         set mask [maskhost "$nick!$uhost" 3]
         foreach c [channels] {
            pushmode $c +b $mask
         }
      }
   }
}Code: Select all
bind PUB - * pub:spam
bind CTCP - ACTION ctcp:spam
bind PART - * part:spam
bind SIGN - * sign:spam
array set spamlist {} 
proc pub:spam {nick uhost hand chan txt} {
   global spamlist
   lappend spamlist($chan) [list $nick [clock seconds]]
}
proc ctcp:spam {nick uhost hand chan key txt} {
   global spamlist
   lappend spamlist($chan) [list $nick [clock seconds]]
}
proc part:spam {nick uhost hand chan {txt ""}} {
   ban:spam $nick $uhost $chan
}
proc sign:spam {nick uhost hand chan txt} {
   ban:spam $nick $uhost $chan
}
proc ban:spam {nick uhost chan} {
   if {![info exists ::spamlist($chan)]} return
   set pos [lsearch -nocase [dict keys [join $::spamlist($chan)]] $nick]
   if {$pos > -1} {
      scan [lindex $::spamlist($chan) $pos] {%s%s} user time
      set now [clock seconds]
      if {[expr $now - $time] < 6} {
         set ::spamlist($chan) [lreplace $::spamlist($chan) $pos $pos]
         set mask [maskhost "$nick!$uhost" 3]
            pushmode $chan +b $mask
      }
   }
}
Code: Select all
proc ban:spam {nick uhost chan} {
   if {![info exists ::spamlist($chan)]} {
      putserv "PRIVMSG $chan :Can't find spamlist for $chan"
      return
   }
   set pos [lsearch -nocase [dict keys [join $::spamlist($chan)]] $nick]
   if {$pos > -1} {
      scan [lindex $::spamlist($chan) $pos] {%s%s} user time
      set now [clock seconds]
      if {[expr $now - $time] < 6} {
         set ::spamlist($chan) [lreplace $::spamlist($chan) $pos $pos]
         set mask [maskhost "$nick!$uhost" 3]
         pushmode $chan +b $mask
      } else {
         putserv "PRIVMSG $chan :More than 5s, doing nothing"
     }
   } else {
      putserv "PRIVMSG $chan :Can't find $nick in spamlist of $chan"
   }
}