egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to match detect this kind of flood

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Gulio
Halfop


Joined: 01 Nov 2020
Posts: 73

PostPosted: Wed Jul 21, 2021 3:37 am    Post subject: how to match detect this kind of flood Reply with quote

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
         }

      }
   }
}

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber