This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

how to stop :******* flooding?

Old posts that have not been replied to for several years.
Locked
T
Tex
Voice
Posts: 11
Joined: Sat Dec 14, 2002 8:27 pm
Location: Lendava, Slovenia

how to stop :******* flooding?

Post by Tex »

hello..
well..doe's anyone have some .tcl to stop the :*************** and :@@@@@@@@@@@ and heloo !!!!!!!!!!!!!!!!!!!!!!!!!!!!! flooding on channel?
so that max 20 ! , @ and * would be allowed in one line on channel..

in mirc looks like that..

on 1:TEXT:*:#testek: {
/if ($count($1-,$chr(33)) > 20) {
/kick #testek $nick max 20 !-s allowed!!!
/mode #testek +b $address($nick,3)
}
/if ($count($1-,$chr(42)) > 20) {
/kick #testek $nick max 20 *-s allowed!!!
/mode #testek +b $address($nick,3)
}
/if ($count($1-,$chr(64)) > 20) {
/kick #testek $nick max 25 @-s allowed!!!
/mode #testek +b $address($nick,3)
}
}

plaese..and sry fo my bad english.. ;)
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

set r "max 20 !,@,or * allowed"
bind pubm - * check
proc check {n u h c t} {
  set len [string length $t]
  set x 0; set y 0; set z 0
  for {set i 0} {$i < $len} {incr i} {
    if {[string index $t $i] == "!"} {incr x
    } elseif {[string index $t $i] == "@"} {incr y
    } elseif {[string index $t $i] == "*"} {incr z}
  }
  if {$x > 20 || $y || 20 || $z > 20} {
    newchanban $c [maskhost $n!$u] foo $::r
    putserv "kick $c $n :$::r"
  }
}
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

...or use "regexp -all" to do the counting

Code: Select all

if {[string len $a]<21} {
	# too short..no point checking any further
	return 0
} elseif {[regexp -all ! $a]>20} {

} elseif {[regexp -all \\* $a]>20} {

} elseif {[regexp -all @ $a]>20} {

}
Have you ever read "The Manual"?
Locked