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 

Lines Flood first time set muteban second time full ban

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Fri May 13, 2022 1:27 am    Post subject: Lines Flood first time set muteban second time full ban Reply with quote

greetz im using this code and it works as intended it sets a temporare muteban after 3 lines in 4 seconds are posted in channel and unsets it after few seconds but we noticed some are in channel to keep flooding so setting another temporare muteban is useless we wanted to set a full ban the second time it happens and unset the counter

heres what we work with:

Code:

# lines flood
set textftrigger 3:4

bind ctcp - "ACTION" actionf
proc actionf {n u h d k t} {
  if {[isbotnick $d]} {  return 0  }
  textf $n $u $h $d $t
}


bind pubm - * textf
proc textf {nick uhost hand chan text} {
 if {[matchattr [nick2hand $nick] fmo|fmo $chan] || [isvoice $nick $chan]} { return }
 global textftrigger textf
 if {[string match -nocase #help $chan]} { return 0 }
 if {![info exists textf([set f [string tolower $uhost:$chan]])]} {
  set textf($f) 0
 }
 utimer [lindex [split $textftrigger :] 1] [list incr textf($f) -1]
 if {[incr textf($f)] >= [lindex [split $textftrigger :] 0]} {
  if {[isvoice $nick $chan]} {  pushmode2  $chan -v  $nick }
  pushmode $chan +b m:*!*@[lindex [split $uhost @] 1]
  putserv "notice $nick :[colors] you have been temporary muted due to mass text lines....... slow down [end]"
  after [expr {30*1000*1}] [list pushmode2 $chan -b m:*!*@[lindex [split $uhost @] 1]]
 }
}

 
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Sat May 14, 2022 7:29 pm    Post subject: Reply with quote

The idea is to set a ban the second time it's triggered let's say within 2 minutes without having the timer removing it again
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Mon May 16, 2022 4:24 am    Post subject: Reply with quote

i guess it needs some sort of counter based on channel:nick:host
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Wed May 18, 2022 3:13 am    Post subject: Reply with quote

for example:
if the first time its triggered it sets a muteban and unsets it after like 30 secs

Quote:

09:06:19 (Hitoshi) : ilpwinwgzr omplezjwnd
09:06:20 (Hitoshi) : sqlbmhpief rsbyhvvopn
09:06:20 (Hitoshi) : ulnoexbkwy zlqktpxexd
09:06:21 @Falcon Sets Mode on #TestChan to: +b m:*!*@All4Masti-ac4.9jb.714.980.IP

09:06:51 @Falcon Sets Mode on #TestChan to: -b m:*!*@All4Masti-ac4.9jb.714.980.IP




and when it triggers a second time from same $chan:$host:$nick within lets say 2 minutes then set a full ban without removing it

Quote:

09:07:25 (Hitoshi) : ftpdvzjtrd tkbnsclrdl
09:07:26 (Hitoshi) : jqdmelwvvb tffnnzkcvp
09:07:26 (Hitoshi) : jwbeufyoad gwisxzdymv
09:07:26 (Hitoshi) : wgrhxrjgso gqwmsyrtjs
09:07:26 @Falcon Sets Mode on #TestChan to: +b *!*@All4Masti-ac4.9jb.714.980.IP
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Wed May 18, 2022 4:55 am    Post subject: Reply with quote

Since you are working with scripts, you may be able to do that.

Here is an example (not tested), try to understand it.
Code:
# lines flood
set textftrigger 3:4
set warned {}

bind ctcp - "ACTION" actionf
proc actionf {n u h d k t} {
   if {[isbotnick $d]} {  return 0  }
   textf $n $u $h $d $t
}


bind pubm - * textf
proc textf {nick uhost hand chan text} {
   global textftrigger textf warned
   if {[matchattr [nick2hand $nick] fmo|fmo $chan] || [isvoice $nick $chan]} { return }
   if {[string match -nocase #help $chan]} { return 0 }
   if {![info exists textf([set f [string tolower $uhost:$chan]])]} {
      set textf($f) 0
   }
   set umask "${chan}.${uhost}.${nick}"
   utimer [lindex [split $textftrigger :] 1] [list incr textf($f) -1]
   if {[incr textf($f)] >= [lindex [split $textftrigger :] 0]} {
      if {[isvoice $nick $chan]} {  pushmode2  $chan -v  $nick }
      if {[lsearch $warned $umask]>-1} {
         pushmode $chan +b *!*@[lindex [split $uhost @] 1]
         putkick $chan $nick "Sorry but repeating flood"
         set warned [lreplace $warned [lsearch $warned $umask] [lsearch $warned $umask]]
      } else {
         lappend warned $umask
         pushmode $chan +b m:*!*@[lindex [split $uhost @] 1]
         putserv "notice $nick :[colors] you have been temporary muted due to mass text lines....... slow down [end]"
         after [expr {30*1000*1}] [list pushmode2 $chan -b m:*!*@[lindex [split $uhost @] 1]]
      }
   }
}

_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Wed May 18, 2022 6:36 am    Post subject: Reply with quote

thanks CrazyCat for the reply ive tried your suggested code it seems to work as expected so far, .... i will test it some more thanks so far CrazyCat
Back to top
View user's profile Send private message
Arnold_X-P
Master


Joined: 30 Oct 2006
Posts: 223
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Sun Jul 03, 2022 10:19 pm    Post subject: Reply with quote

CrazyCat wrote:
Since you are working with scripts, you may be able to do that.

Here is an example (not tested), try to understand it.
Code:
# lines flood
set textftrigger 3:4
  set repeatwarnmsg1 "stop please"
  set repeatwarnmsg2 "Final warning.."
set warned {}

bind ctcp - "ACTION" actionf
proc actionf {n u h d k t} {
   if {[isbotnick $d]} {  return 0  }
   textf $n $u $h $d $t
}


bind pubm - * textf
proc textf {nick uhost hand chan text} {
   global textftrigger textf warned
   if {[matchattr [nick2hand $nick] fmo|fmo $chan] || [isvoice $nick $chan]} { return }
   if {[string match -nocase #help $chan]} { return 0 }
   if {![info exists textf([set f [string tolower $uhost:$chan]])]} {
      set textf($f) 0
   }
   set umask "${chan}.${uhost}.${nick}"
   utimer [lindex [split $textftrigger :] 1] [list incr textf($f) -1]
   if {[incr textf($f)] >= [lindex [split $textftrigger :] 0]} {
      if {[isvoice $nick $chan]} {  pushmode2  $chan -v  $nick }
      if {[lsearch $warned $umask]>-1} {
         pushmode $chan +b *!*@[lindex [split $uhost @] 1]
         putkick $chan $nick "Sorry but repeating flood"
         set warned [lreplace $warned [lsearch $warned $umask] [lsearch $warned $umask]]
      } else {
         lappend warned $umask
         pushmode $chan +b m:*!*@[lindex [split $uhost @] 1]
         putserv "notice $nick :[colors] you have been temporary muted due to mass text lines....... slow down [end]"
         after [expr {30*1000*1}] [list pushmode2 $chan -b m:*!*@[lindex [split $uhost @] 1]]
      }
   }
}


it can be added that it launches two warning phrases and the third definitive ban???
set repeatwarnmsg1 "stop please"
set repeatwarnmsg2 "Final warning.."
_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Mon Jul 04, 2022 2:29 am    Post subject: Reply with quote

You can try the following code (untested):
Code:
# lines flood
set textftrigger 3:4
set repeatwarnmsg {"stop please" "Final warning.."}
set warned {}

bind ctcp - "ACTION" actionf
proc actionf {n u h d k t} {
   if {[isbotnick $d]} {  return 0  }
   textf $n $u $h $d $t
}


bind pubm - * textf
proc textf {nick uhost hand chan text} {
   global textftrigger textf warned
   if {[matchattr [nick2hand $nick] fmo|fmo $chan] || [isvoice $nick $chan]} { return }
   if {[string match -nocase #help $chan]} { return 0 }
   if {![info exists textf([set f [string tolower $uhost:$chan]])]} {
      set textf($f) 0
   }
   set umask "${chan}.${uhost}.${nick}"
   utimer [lindex [split $textftrigger :] 1] [list incr textf($f) -1]
   if {[incr textf($f)] >= [lindex [split $textftrigger :] 0]} {
      if {[isvoice $nick $chan]} {  pushmode2  $chan -v  $nick }
      if {[lsearch $warned $umask]>-1 && [info exists ::cpt($umask)] && $::cpt($umask)>=[llength $::repeatwarnmsg]} {
         pushmode $chan +b *!*@[lindex [split $uhost @] 1]
         putkick $chan $nick "Sorry but repeating flood"
         set warned [lreplace $warned [lsearch $warned $umask] [lsearch $warned $umask]]
         unset ::cpt($umask)
      } else {
         if {[lsearch $warned $umask]==-1} { lappend warned $umask }
         incr ::cpt($umask) 1
         pushmode $chan +b m:*!*@[lindex [split $uhost @] 1]
         putserv "notice $nick :[colors] [lindex $::repeatwarnmsg $::cpt($umask)] [end]"
         after [expr {30*1000*1}] [list pushmode2 $chan -b m:*!*@[lindex [split $uhost @] 1]]
      }
   }
}

If you want to allow more warnings, just add messages in repeatwarnmsg, the user will be ban when all the messages are sent
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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