Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Wed Jul 21, 2021 3:37 am Post subject: how to match detect this kind of flood |
|
|
how to do it to match 2 letters and down for lines from 1 nick or multi nick host
text and action also when is match *.irccloud.com and *.mibbit.com to send ban on *!iden@*
Code: |
[16:31:38] <guest827> A
[16:31:40] <guest827> B
[16:31:42] <guest827> C
[16:31:45] <guest827> Ç
[16:31:47] <guest827> D
[16:31:52] <guest827> DH
[16:31:55] <guest827> E
[16:31:57] <guest827> Ë
|
this code is take it from Spike^^ code
Code: |
Line 44: NOTICE: Found constant "bflood" which is also a variable.
utimer $bflood(unsettime) [list array unset bflood $chan:$nick]
|
Code: |
set bflood(maxlength) 2
set bflood(unsettime) 5
bind pubm - * pubm:byteflood
proc pubm:byteflood {nick host hand chan text} {
global bflood
if {![botisop $chan] || [isop $nick $chan]} { return 0 }
if {[validuser $hand] && [matchattr $hand +bfmo|fmo $chan]} { return 0 }
set nick [string tolower $nick]
set chan [string tolower $chan]
set length [string length $text]
set text [lindex [split $text ":"] 0]
if {[info exists bflood($chan:$nick)]} { incr length $bflood($chan:$nick) }
if {($length > $bflood(maxlength))} {
foreach user $text {
if {![onchan $user $chan]} {
putserv "NOTICE $nick $user is not on channel $chan"
} else {
if {[set chost [getchanhost $nick $chan]] ne ""} {
switch -glob -- $chost {
{*.irccloud.com} - {*.mibbit.com} {
if {[isvoice $nick $chan]} { pushmode $chan -v $nick }
set mask *![lindex [split $chost @] 0]@*
}
{default} {
set mask [maskhost "$user!$chost" 2]
}
}
array unset bflood $chan:$nick
return 0
}
if {![info exists bflood($chan:$nick)]} {
utimer $bflood(unsettime) [list array unset bflood $chan:$nick]
}
set bflood($chan:$nick) $length
return 0
}
}
}
}
|
|
|