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.

Stop the flooding from different nicknames.

Old posts that have not been replied to for several years.
Locked
N
Nucleus
Voice
Posts: 34
Joined: Fri Jul 09, 2004 3:35 am

Stop the flooding from different nicknames.

Post by Nucleus »

Code: Select all

Floodbot1: Flood Flood Flood Flood Flood Flood Flood Flood Flood Flood 
Floodbot2: Flood Flood Flood Flood Flood Flood Flood Flood Flood Flood 
Floodbot3: Flood Flood Flood Flood Flood Flood Flood Flood Flood Flood 
Floodbot4: Flood Flood Flood Flood Flood Flood Flood Flood Flood Flood
If all this was coming from the same nickname, the repeat script would simply ban/kick the user. The problem is that it's coming from different nicknames. I do not want to use sentinel.tcl. Simply too many -useless for me- options. I need a script that will detect if the same text is coming from different users in the channel and ban/kick the matching offenders (channel ban).

Thank you.
N
Nucleus
Voice
Posts: 34
Joined: Fri Jul 09, 2004 3:35 am

Post by Nucleus »

Come to think of it, someone already wrote this kind of script on another post, but the post was deleted. Anyway, i'm not sure, any help would be appreciated.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

there is a standalone repeat.tcl from the netbots package. it doesnt count by nicknames, but by uhost + channel.
but probably you didnt detail what you wanted, so probably the nicknames do not share same/similar uhosts (for similar you could simply use maskhost on the uhost).
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Nucleus wrote:Come to think of it, someone already wrote this kind of script on another post, but the post was deleted. Anyway, i'm not sure, any help would be appreciated.
I think it was Awyeah and another user that were working on that script. I am sure if you ask Awyeah nicely he can dig it out for you :)
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You mean that repeat script ? This is a rewrite so again we might pass through all those errors :P

Code: Select all

#set number of messages in how many seconds to lock chan.
set floodr(msgsec) 7:2

#set length of messages that trigger the script.
set floodr(len) 200

#set kick msg
set floodr(kmsg) "Flooder detected."

#set lock time.
set floodr(ltime) 10

bind pubm - * lock:pubm
bind notc - * lock:notc
set floodr(msgs) [lindex [split $floodr(msgsec) :] 0]
set floodr(secs) [lindex [split $floodr(msgsec) :] 1]

proc lock:pubm {nick uhost hand chan arg} {
 global floodr floodpub pubnicks
 if {![info exists floodpub($chan)]} { set floodpub($chan) 0 }
 fnicklappend $floodr(secs) pubnicks($chan) $nick:*!*@[lindex [split $uhost @] 1]
 if {[tincrease $floodr(secs) floodpub($chan)] == $floodr(msgs)} {
  putquick "MODE $chan +mR" -next
  utimer $floodr(ltime) [list puthelp "MODE $chan -mR"]
  foreach floodnick $pubnicks($chan) {
   putquick "KICK $chan [lindex [split $floodnick :] 0] :$floodr(kmsg)"
   pushmode $chan +b [lindex [split $floodnick :] 1]
  }
 }
}

proc lock:notc {nick uhost hand arg chan} {
 global floodr floodnotc notcnicks botnick
 if {[lindex [split $chan "@"] 0] == $botnick || [string index $chan 0] == "@"} {return 0}
 if {![info exists floodnotc($chan)]} { set floodnotc($chan) 0 }
 fnicklappend $floodr(secs) notcnicks($chan) $nick:*!*@[lindex [split $uhost @] 1]
 if {[tincrease $floodr(secs) floodnotc($chan)] == $floodr(msgs)} {
  putquick "MODE $chan +mR" -next
  utimer $floodr(ltime) [list puthelp "MODE $chan -mR"]
  foreach floodnick $notcnicks($chan) {
   putquick "KICK $chan [lindex [split $floodnick :] 0] :$floodr(kmsg)"
   pushmode $chan +b [lindex [split $floodnick :] 1]
  }
 }
}
 
proc tincrease {value varinc} {
 upvar $varinc varvalue
 incr varvalue
 utimer $value [list tdecrease $varinc]
 return $varvalue
}

proc tdecrease varinc {
 upvar $varinc varvalue
 if {$varvalue > 0} {
  incr varvalue -1
 }
 return
}

proc fnicklappend {value varnicks nickhost} {
 upvar $varnicks nicklist
 lappend nicklist  $nickhost
 utimer $value [list fnickreplace $varnicks $nickhost]
}

proc fnickreplace {varnicks nickhost} {
 upvar $varnicks nicklist
 set nicklist [lreplace $nicklist [lsearch -exact $nicklist $nickhost] [lsearch -exact $nicklist $nickhost]]
 return
}
This will lock the channel and kickban the flooders when offence is reached.

Edit: added bankick flooders feature.
Last edited by Sir_Fz on Wed May 11, 2005 4:12 pm, edited 3 times in total.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Read my second last post in this thread:
http://forum.egghelp.org/viewtopic.php?t=9424

I didn't get time to test the script yet, but it works fine without errors I guess.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
N
Nucleus
Voice
Posts: 34
Joined: Fri Jul 09, 2004 3:35 am

Post by Nucleus »

Sir_Fz wrote:You mean that repeat script ? This is a rewrite so again we might pass through all those errors :P

Code: Select all

#set number of messages in how many seconds to lock chan.
set floodr(msgsec) 7:2

#set length of messages that trigger the script.
set floodr(len) 200

#set kick msg
set flood(kmsg) "Flooder detected."

bind pubm - * lock:pubm
bind notc - * lock:notc
set floodr(msgs) [lindex [split $floodr(msgsec) :] 0]
set floodr(secs) [lindex [split $floodr(msgsec) :] 1]

proc lock:pubm {nick uhost hand chan arg} {
 global floodr floodpub pubnicks
 if {![info exists floodpub($chan)]} { set floodpub($chan) 0 }
 fnicklappend $floodr(secs) pubnicks($chan) $nick:*!*@[lindex [split $uhost @] 1]
 if {[tincrease $floodr(secs) floodpub($chan)] == $floodr(msgs)} {
  putquick "MODE $chan +mR" -next
  foreach floodnick $pubnicks($chan) {
   putquick "KICK $chan [lindex [split $floodnick :] 0] :$floodr(kmsg)"
   pushmode $chan +b [lindex [split $floodnick :] 1]
  }
 }
}

proc lock:notc {nick uhost hand arg chan} {
 global floodr floodnotc notcnicks
 if {[lindex [split $chan "@"] 0] == $botnick || [string index $chan 0] == "@"} {return 0}
 if {![info exists floodnotc($chan)]} { set floodnotc($chan) 0 }
 fnicklappend $floodr(secs) notcnicks($chan) $nick:*!*@[lindex [split $uhost @] 1]
 if {[tincrease $floodr(secs) floodnotc($chan)] == $floodr(msgs)} {
  putquick "MODE $chan +mR" -next
  foreach floodnick $notcnicks($chan) {
   putquick "KICK $chan [lindex [split $floodnick :] 0] :$floodr(kmsg)"
   pushmode $chan +b [lindex [split $floodnick :] 1]
  }
 }
}
 
proc tincrease {value varinc} {
 upvar $varinc varvalue
 incr varvalue
 utimer $value [list tdecrease $varinc]
 return $varvalue
}

proc tdecrease varinc {
 upvar $varinc varvalue
 if {$varvalue > 0} {
  incr varvalue -1
 }
 return
}

proc fnicklappend {value varnicks nickhost} {
 upvar $varnicks nicklist
 lappend nicklist  $nickhost
 utimer $value [list fnickreplace $varnicks $nickhost]
}

proc fnickreplace {varnicks nickhost} {
 upvar $varnicks nicklist
 set nicklist [lreplace $nicklist [lsearch -exact $nicklist $nickhost] [lsearch -exact $nicklist $nickhost]]
 return
}
This will lock the channel and kickban the flooders when offence is reached.

Edit: added bankick flooders feature.
How many minutes will it keep the channel locked?
I also get this error in the partyline:

Code: Select all

[08:23] Tcl error [lock:notc]: can't read "botnick": no such variable
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

In the lock:notc proc, in the second line, global, declare $botnick variable as global, by adding botnick into the line.

Code: Select all

global botnick
OR just replace $botnick by $::botnick everywhere in the script.

In this script as far as I can see the lock will remain on, untill it is manually removed by someone, since there is no utimer or timer to remove the lock in the script, just a code place it.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
N
Nucleus
Voice
Posts: 34
Joined: Fri Jul 09, 2004 3:35 am

Post by Nucleus »

how can i add a timer to remove the lock?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

add

Code: Select all

utimer <seconds> [list putserv "MODE $chan -mR"]
under

Code: Select all

putquick "MODE $chan +mR" -next
N
Nucleus
Voice
Posts: 34
Joined: Fri Jul 09, 2004 3:35 am

Post by Nucleus »

uploaded :) Now waiting for an attack :P
N
Nucleus
Voice
Posts: 34
Joined: Fri Jul 09, 2004 3:35 am

Post by Nucleus »

Partyline: [12:08] Tcl error [lock:pubm]: can't read "floodr(kmsg)": no such element in array

Channel:

[19:09:03] * Eggdrop1 sets mode: +m
[19:09:13] * Eggdrop1 sets mode: -m

In the script i set the timer 10 seconds
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

A little typo, flood(kmsg) should be floodr(kmsg). (edited the code)
Locked