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.

Repeat kick on specific command or text

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
TimeRider
Voice
Posts: 32
Joined: Tue Jul 07, 2020 3:46 pm
Contact:

Repeat kick on specific command or text

Post by TimeRider »

Hi, I am looking for a repeat kick script that would either mute, kick or ban a user from the channel for repeating more than 4 times in 30 seconds like this:

Code: Select all

.tell nick some random text flood
.tell nick some random text flooding
.tell nick some random text flood
.tell nick some random text flooding
I am using this .tell command in channel so users can send offline messages to other users but it is getting abused.

If anyone could please write me this code, I would be grateful.
User avatar
CrazyCat
Revered One
Posts: 1304
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: Repeat kick on specific command or text

Post by CrazyCat »

Why use a tcl when you have the native setting flood-msg ?
User avatar
TimeRider
Voice
Posts: 32
Joined: Tue Jul 07, 2020 3:46 pm
Contact:

Re: Repeat kick on specific command or text

Post by TimeRider »

Because I have turned off the native flood-msg as I have the Duckhunt game in the channel which uses !bang command too.

So, I only need it for the abusers who are flooding the channel with the .tell command as above.
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Re: Repeat kick on specific command or text

Post by simo »

Code: Select all



bind pubm * "% .tell*" Repeated:Static-Text

set chantexttrigger "4:30"


proc Repeated:Static-Text {nick uhost hand chan text} {  
  if {[matchattr $hand of|of $chan] || [isop $nick $chan] || [ishalfop $nick $chan] || [isbotnick $nick]} { return 0 }
    global chantexttrigger chantextflood  

    set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]


set user $nick:$chan

 if {![info exists chantextflood($user)]} { set chantextflood($user) 0 ; utimer [lindex [split $chantexttrigger :] 1] [list text:flood:list $user] }


 if {[incr chantextflood($user)] >= [lindex [split $chantexttrigger :] 0]} {
   if {[isvoice $nick $chan]} { pushmode $chan -v $nick }


      if {[string match -nocase "*@*irccloud*" $uhost]} {  
                    set ident [string trimleft [lindex [split $uhost @] 0] "~"]
                    set xbmaskx [string map {sid id uid id} $ident]
                    set bmask  m:*!*$xbmaskx@*
                      pushmode $chan +b $bmask  
                  }  else { 
                      set bmask "m:*!*@[lindex [split $uhost "@"] 1]"
                       pushmode $chan +b $bmask 
}

 
   if {[info exists chantextflood($user)]} { unset chantextflood($user) }
   }
 flushmode $chan
}


proc text:flood:list u {
global chantextflood
if {[info exists chantextflood($u)]} { incr chantextflood($u) -1 }
}

Last edited by simo on Tue Apr 02, 2024 12:41 pm, edited 1 time in total.
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Re: Repeat kick on specific command or text

Post by willyw »

Hi, I am looking for a repeat kick script that would either mute, kick or ban a user from the channel for repeating more than 4 times in 30 seconds like this:
Are you dead set on using a kick or ban? Because you have reminded me of something else, that may be suitable.

viewtopic.php?p=45537&hilit=throttle#p45537

Your current script could be edited to incorporate that code as a throttle. The user can use the command once, then it doesn't work for him again, for xx seconds. The idea is that this ruins his fun with hammering the command.

This is just an alternative idea that came to mind. ;)
I've used that code by user, in that old post linked above, many times. It's great.
However, if you feel you need to do a ban or kick, then just ignore this.

I am using this .tell command in channel so users can send offline messages to other users ...
I'm curious about this. :)
Is this script available for download somewhere? I didn't see it on the archive.
Thanks.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
User avatar
TimeRider
Voice
Posts: 32
Joined: Tue Jul 07, 2020 3:46 pm
Contact:

Re: Repeat kick on specific command or text

Post by TimeRider »

simo wrote: Tue Apr 02, 2024 10:17 am

Code: Select all



bind pubm * "% .tell*" Repeated:Static-Text

set chantexttrigger "4:30"


proc Repeated:Static-Text {nick uhost hand chan text} {  
  if {[matchattr $hand of|of $chan] || [isop $nick $chan] || [ishalfop $nick $chan] || [isbotnick $nick]} { return 0 }
    global chantexttrigger chantextflood  

    set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]


set user $nick:$chan

 if {![info exists chantextflood($user)]} { set chantextflood($user) 0 ; utimer [lindex [split $chantexttrigger :] 1] [list text:flood:list $user] }


 if {[incr chantextflood($user)] >= [lindex [split $chantexttrigger :] 0]} {
   if {[isvoice $nick $chan]} { pushmode $chan -v $nick }


      if {[string match -nocase "*@*irccloud*" $uhost]} {  
                    set ident [string trimleft [lindex [split $uhost @] 0] "~"]
                    set xbmaskx [string map {sid id uid id} $ident]
                    set bmask  m:*!*$xbmaskx@*
                      pushmode $chan +b $bmask  
                  }  else { 
                      set bmask "m:*!*@[lindex [split $uhost "@"] 1]"
                       pushmode $chan +b $bmask 
}

 
   if {[info exists chantextflood($user)]} { unset chantextflood($user) }
   }
 flushmode $chan
}


proc text:flood:list u {
global chantextflood
if {[info exists chantextflood($u)]} { incr chantextflood($u) -1 }
}

Hi simo, thank you, the script seems to be working. Is it also possible to add a timer of when the mute ban expires?
willyw wrote: Tue Apr 02, 2024 12:40 pm

Are you dead set on using a kick or ban? Because you have reminded me of something else, that may be suitable.


I'm curious about this. :)
Is this script available for download somewhere? I didn't see it on the archive.
Thanks.
Hi willy, yes, but, a mute ban would also be nice to set with a option of timer of when the mute ban would be removed.

Unfortunately, the script or bot I am using for the .tell feature is a Sopel bot which is build with python. But, it would have been nice to add a throttle via python.

For now, it an eggdrop bot muting or banning the user is something i can see as solution.
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Re: Repeat kick on specific command or text

Post by simo »

Code: Select all


bind pubm * "% .tell*" Repeated:Static-Text

set chantexttrigger "4:30"


proc Repeated:Static-Text {nick uhost hand chan text} {  
  if {[matchattr $hand of|of $chan] || [isop $nick $chan] || [ishalfop $nick $chan] || [isbotnick $nick]} { return 0 }
    global chantexttrigger chantextflood  

    set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]


set user $nick:$chan

 if {![info exists chantextflood($user)]} { set chantextflood($user) 0 ; utimer [lindex [split $chantexttrigger :] 1] [list text:flood:list $user] }


 if {[incr chantextflood($user)] >= [lindex [split $chantexttrigger :] 0]} {

   if {[isvoice $nick $chan]} { pushmode $chan -v $nick }

      if {[string match -nocase "*@*irccloud*" $uhost]} {  
                    set ident [string trimleft [lindex [split $uhost @] 0] "~"]
                    set xbmaskx [string map {sid id uid id} $ident]
                    set bmask  m:*!*$xbmaskx@*
                   if {![ischanban $bmask $chan]} { pushmode $chan +b $bmask ; timer 10 [list timed:ban $chan $bmask]} 
                  }  else { 
                      set bmask "m:*!*@[lindex [split $uhost "@"] 1]"
                   if {![ischanban $bmask $chan]} { pushmode $chan +b $bmask ; timer 10 [list timed:ban $chan $bmask]} 
}

 
   if {[info exists chantextflood($user)]} { unset chantextflood($user) }
   }
 flushmode $chan
}

 


proc timed:ban {chan banmask} {
  if {[ischanban $banmask $chan]} {
    pushmode $chan -b  $banmask 
  } else { putlog "$banmask is already removed from $chan" }
}



proc text:flood:list u {
global chantextflood
if {[info exists chantextflood($u)]} { incr chantextflood($u) -1 }
}

User avatar
TimeRider
Voice
Posts: 32
Joined: Tue Jul 07, 2020 3:46 pm
Contact:

Re: Repeat kick on specific command or text

Post by TimeRider »

Simo, there seems to be a problem that the timer of 30 seconds not being to reset itself sometimes. Some users are getting mute banned even after using .tell after 30 seconds.
Post Reply