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.

Mass Join Protection with same ident

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
F
F|irT
Voice
Posts: 30
Joined: Thu Apr 30, 2015 11:23 pm
Location: Pakistan

Mass Join Protection with same ident

Post by F|irT »

Hello,

Admin & All Tcl Maker..

From Past few weeks we are facing flooder on our channel. i am running all protection 4.7 last version in my eggdrop now i add extra tcl multihostrepeat but still we are fail to control the flooder.. they are doing it badly and heavly here are some logs....
Joins: sharaaby (~sharaaby@pool-108-34-162-69.prvdri.fios.verizon.net)
* Joins: saba_shah7184 (~saba_shah@85.17.155.77)
* Joins: Re[V]enge1 (~Re[V]enge@180.250.160.58)
* Joins: MeReDeath (~MeReDeath@185.76.35.65)
* Joins: faded2dust (~faded2dus@180.250.88.174)
* Joins: Shah___4021 (~Shah___40@186.194.240.186)
* Joins: Nicedoctor7325 (~Nicedocto@109-207-54-34.ronus.pl)
* Joins: Aaatif1083 (~Aaatif108@199.168.148.147)
* Joins: aat_ka7462 (~aat_ka746@199.168.148.147)
* Joins: masood3282 (~masood328@86.122.61.247)
* SLeEpINg sets mode: +mM-k join.flood
* NoNStOp sets mode: +mM-k join.flood
* Joins: heena___ (heena___@39.32.139.109)
* NoNStOp sets mode: +mM-k join.flood
* Joins: hughskype (hughskype@host86-164-230-146.range86-164.btcentralplus.com)
<sharaaby> f|irt ka khas taTu irc par apni behn maa chudwanay aya hay :D Candy|guy ayaz and F|irt are same one guy three nicks Karimabad ka ismaili bharwa aur Munda_punjabi iss ka bharwa :D ( Munda_punjabi ne bund marwai thi so bukhar ho gaya Moody__Chatter too apni chikni pathani behan kay sat apni bund bhe paish kar incest kee pedawaaroo
<DeadlyDashing2177> f|irt ka khas taTu irc par apni behn maa chudwanay aya hay :D Candy|guy ayaz and F|irt are same one guy three nicks Karimabad ka ismaili bharwa aur Munda_punjabi iss ka bharwa :D ( Munda_punjabi ne bund marwai thi so bukhar ho gaya Moody__Chatter too apni chikni pathani behan kay sat apni bund bhe paish kar incest kee pedawaaroo
<Sonnett7650> f|irt ka khas taTu irc par apni behn maa chudwanay aya hay :D Candy|guy ayaz and F|irt are same one guy three nicks Karimabad ka ismaili bharwa aur Munda_punjabi iss ka bharwa :D ( Munda_punjabi ne bund marwai thi so bukhar ho gaya Moody__Chatter too apni chikni pathani behan kay sat apni bund bhe paish kar incest kee pedawaaroo
<Re[V]enge1> f|irt ka khas taTu irc par apni behn maa chudwanay aya hay :D Candy|guy ayaz and F|irt are same one guy three nicks Karimabad ka ismaili bharwa aur Munda_punjabi iss ka bharwa :D ( Munda_punjabi ne bund marwai thi so bukhar ho gaya Moody__Chatter too apni chikni pathani behan kay sat apni bund bhe paish kar incest kee pedawaaroo
* sharaaby was kicked by NoNStOp (Excess chars detected. (330 chars in 0.0 secs) :: [Sun May 3 01:01:31 2015] - Banned 20 minutes ·37245·)
* NoNStOp sets mode: +b *!*@pool-108-34-162-69.prvdri.fios.verizon.net
<saba_shah7184> f|irt ka khas taTu irc par apni behn maa chudwanay aya hay :D Candy|guy ayaz and F|irt are same one guy three nicks Karimabad ka ismaili bharwa aur Munda_punjabi iss ka bharwa :D ( Munda_punjabi ne bund marwai thi so bukhar ho gaya Moody__Chatter too apni chikni pathani behan kay sat apni bund bhe paish kar incest kee pedawaaroo
* NoNStOp sets mode: +mM-k chars.flood
* Sonnett7650 was kicked by NoNStOp (Excess chars detected. (330 chars in 0.0 secs) :: [Sun May 3 01:01:31 2015] - Banned 20 minutes ·37246·)
* SLeEpINg sets mode: +mM-k chars.flood
* DeadlyDashing2177 was kicked by SLeEpINg (Excess chars detected. - Banned 20 minutes © X-x-X PrOtEcTiON ©)
* SLeEpINg sets mode: +m-k FreEz
* NoNStOp sets mode: +b *!*@103.15.165.34
* SLeEpINg sets mode: +bbb *!*@*.fios.verizon.net *!*@103.15.165.* *!*@180.250.160.*
* NoNStOp sets mode: +M-k wait
* Joins: manblore (~qwebirc@122.172.51.41)
* Parts: Baji_k_BF (~hii@39.33.28.167)
* Parts: airforceman-pk (~sadgjj@203.124.29.42)
* Re[V]enge1 was kicked by SLeEpINg (Excess chars detected. - Banned 20 minutes © X-x-X PrOtEcTiON ©)
* SLeEpINg sets mode: -mk FreEz
* SLeEpINg sets mode: -mM
* Quits: khiboy (~khiboy@216.172.142.222) (Ping timeout)
* Quits: desi-m (desim@122.162.191.196) (Client closed connection)
* Joins: ^saif8126 (~^saif8126@221.14.150.29)
* Quits: saba_shah7184 (~saba_shah@85.17.155.77) (Excess Flood)
* Quits: masood3282 (~masood328@86.122.61.247) (Excess Flood)
* Quits: dazler_83722 (~dazler_83@nx-01.tor-exit.network) (Excess Flood)
* Quits: MeReDeath (~MeReDeath@185.76.35.65) (Excess Flood)
* Quits: ^saif8126 (~^saif8126@221.14.150.29) (Excess Flood)
* Quits: faded2dust (~faded2dus@180.250.88.174) (Excess Flood)
* Quits: Nicedoctor7325 (~Nicedocto@109-207-54-34.ronus.pl) (Excess Flood)
* Quits: NaChI970 (~NaChI970@93.183.155.39) (Excess Flood)
* Quits: Shah___4021 (~Shah___40@186.194.240.186) (Excess Flood)
* Parts: Deadweight12 (~Deadweigh@190.205.200.62) (!seen contact F|irt and Munda_punjabi for night of Aidi Pain Done dona done Munda_punjabi / F|irt di pain non lun daz daz dazo daz tay fir dazo daz has has kanjar Munda Has teri wi bund wich lun wa :D done dona done .. daz daz tay fir daz ZarNaH dee bund wich vee LunF|irt, AyAaZ . Candy|Guy, aTaTaBaTaTa these all nicks of one person the one and only ismaili bharwa of karimabad khusra and kutti da puttar)
* NoNStOp sets mode: +b *!*@190.205.200.62
* SLeEpINg sets mode: +b *!*@190.205.200.*
bots just lock the channel mode but does not ban them . if any tcl maker can write one for dalnet pepl it will be very thankfull. just i am looking that bots 1st lock the channel mode ban all the ips and kick them.. all togather.. in ones.. or u guys can do much batter on ur ideas..

That's All..
will be waiting for reply.
F|irT..
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Mass Join Protection with same ident

Post by willyw »

I wonder about the setting of mode +m , shown above.

Those are bots that are doing that, right?

Here:
http://docs.dal.net/docs/modes.html#2.11
we see that +m means that only those with @ or + are allowed to post, if +m mode is set on the channel.

So... how DID all those flood post happen?

Maybe I'm missing something - but it just doesn't look possible.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
F
F|irT
Voice
Posts: 30
Joined: Thu Apr 30, 2015 11:23 pm
Location: Pakistan

Post by F|irT »

i know all about channel mode and function but this happend really .. maybe bot speed is a bit slow they lock the channel after flooding... & in my script shows bot lock the mode b4 flooding.. can it happend ?

All What am i asking for a mass join protection tcl .. if user join the channel with same nick same ident bot lock the channel mode ban them & kick from the channel.. in tcl we can set how many nicks in second ...


2nd Is if user join with same nick like.. F|irTw. F|irT^ F|irTkkk. F|irT_L . F|irT-Kik. F|irT-lOve . bot works the same lock the channel mode ban tham & kick from the channel... with the same function set how many nicks in second if this required in this tcl.. else no need. u guys know much batter..


If any one can write this tcl i will be very thankfull for them..
in Dalnet network i am running a big rush channel and we are totaly fail to control flood . flooder come in the channel and does so easyly . plz help me out for this.. Thank u

I will be waiting for reply..

F|irT...
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Code: Select all

## remove-damn-spam-bots.tcl v1.1 (08May2015) by SpiKe^^ ##


# Spam bots joins, kick-ban on joins:seconds #
set rdsb(flood) 3:10

# Spam bots joins kick-ban reason #
set rdsb(reasn) "Damn Spam Bot!"

# Max number of bans to stack in one mode command #
set rdsb(maxb) 6

# Length of time in minutes to ban damn spam bots #
# NOT USED at this time #set rdsb(btime) 1

# After a valid damn spam bot join flood, script will continue #
# to kick-ban offenders for an additional 'x' seconds #
set rdsb(xpire) 10

# Set channel mode(s) on flood detected. #
# - set empty to disable setting channel modes (ex. set rdsb(mode) "") #
set rdsb(mode) "im"

# Remove these channel modes after how many seconds? #
set rdsb(mrem) 20

# END OF SETTINGS # Don't edit below unless you know what you're doing #

bind join - * rdsb_bindjoin


proc rdsb_bindjoin {nick uhost hand chan} {
  global rdsb rdsc rdsq

  if {[isbotnick $nick]} { return 0 }
  if {[matchattr $hand f|f $chan]} { return 0 }

  if {![string match "~*" $uhost]} { return 0 }

  set user [string range [lindex [split $uhost @] 0] 1 9]
  if {$user ne [string range $nick 0 8]} { return 0 }

  set uhost [string tolower $nick!$uhost]
  set chan [string tolower $chan]
  set utnow [unixtime]
  set target [lindex $rdsb(flood) 0]

  if {[info exists rdsc($chan)]} {
    set uhlist [lassign $rdsc($chan) cnt ut]
    set utend [expr {$ut + [lindex $rdsb(flood) 1]}]
    set expire [expr {$utend + $rdsb(xpire)}]
    if {$cnt < $target} {
      if {$utnow > $utend} { unset rdsc($chan) }
    } elseif {$utnow > $expire} { unset rdsc($chan) }
  }
  if {![info exists rdsc($chan)]} {
    set rdsc($chan) [list 1 $utnow $uhost]
    return 0
  }

  incr cnt
  if {$cnt <= $target} {
    if {[lsearch $uhlist $uhost] == -1} { lappend uhlist $uhost }
    if {$cnt < $target} {
      set rdsc($chan) [linsert $uhlist 0 $cnt $ut]
    } else {
      set rdsc($chan) [list $cnt $ut]
      if {$rdsb(mode) ne "" && [string is digit -strict $rdsb(mrem)]} {
        putquick "MODE $chan +$rdsb(mode)"
        utimer $rdsb(mrem) [list putquick "MODE $chan -$rdsb(mode)"]
      }
      rdsb_dobans $chan $uhlist
    }
    return 0
  }

  if {![info exists rdsq($chan)]} {
    utimer 2 [list rdsb_bque $chan]
    set rdsq($chan) [list $uhost]
  } elseif {[lsearch $rdsq($chan) $uhost] == -1} {
    lappend rdsq($chan) $uhost
  }

  if {[llength $rdsq($chan)] >= $rdsb(maxb)} {
    rdsb_dobans $chan $rdsq($chan)
    set rdsq($chan) ""
  } elseif {[botisop $chan]} { putquick "KICK $chan $nick :$rdsb(reasn)" }
  return 0
}

proc rdsb_dobans {chan uhlist} {
  global rdsb
  if {![botisop $chan]} return
  set banList ""
  set nickList ""
  foreach ele $uhlist {
    scan $ele {%[^!]!%[^@]@%s} nick user host
    set bmask "*!*@$host"
    if {[lsearch $banList $bmask] == -1} { lappend banList $bmask }
    if {[lsearch $nickList $nick] == -1} { lappend nickList $nick }
  }
  stack_ban $chan $rdsb(maxb) $banList
  foreach nk $nickList {
    if {[onchan $nk $chan]} { putquick "KICK $chan $nk :$rdsb(reasn)" }
  }
}

proc stack_ban {chan max banlist} {
  set len [llength $banlist]
  while {$len > 0} {
    if {$len > $max} {
      set mode [string repeat "b" $max]
      set masks [join [lrange $banlist 0 [expr {$max - 1}]]]
      set banlist [lrange $banlist $max end]
      incr len -$max
    } else {
      set mode [string repeat "b" $len]
      set masks [join $banlist]
      set len 0
    }
    putquick "MODE $chan +$mode $masks"
  }
}

proc rdsb_bque {chan} {
  global rdsq
  if {![info exists rdsq($chan)]} { return }
  if {$rdsq($chan) eq ""} { unset rdsq($chan) ; return }
  rdsb_dobans $chan $rdsq($chan)
  unset rdsq($chan)
}

proc rdsb_breset {} {
  global rdsc rdsb
  set utnow [unixtime]
  set target [lindex $rdsb(flood) 0]
  foreach {key val} [array get rdsc] {
    lassign $val cnt ut
    set utend [expr {$ut + [lindex $rdsb(flood) 1]}]
    set expire [expr {$utend + $rdsb(xpire)}]
    if {$cnt < $target} {
      if {$utnow > $utend} { unset rdsc($key) }
    } elseif {$utnow > $expire} { unset rdsc($key) }
  }
  utimer 30 [list rdsb_breset]
}

if {![info exists rdsb_running]} {
  utimer 20 [list rdsb_breset]
  set rdsb_running 1
}

set rdsb(flood) [split $rdsb(flood) :]

putlog "Loaded remove-damn-spam-bots.tcl v1.1 by SpiKe^^"

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i tested it seems to be working fine from what i understand it kick bans clone ident longer than 8 characters if so it executes smooth once again job well done spike^^
F
F|irT
Voice
Posts: 30
Joined: Thu Apr 30, 2015 11:23 pm
Location: Pakistan

The result is excellent.... perfect...

Post by F|irT »

I add this tcl on my bot & the result is excellent work very perfect like what i asked for...

today when i was online flooder try to flood on the channel bot protect the channel from flooder lock the channel mode ban flooder from the channel. here are some logs i save to show ...
* Joins: Ajnabi-Raste5636 (~Ajnabi-Ra@31.129.223.97)
* Joins: dil_meraroyetu_kia930 (~dil_merar@64.185.106.163)
* Joins: p^H^O^O^L3672 (~p^H^O^O^L@31.41.92.68)
* NoNStOp sets mode: +M-k Possible.Flooder
* NoNStOp sets mode: +bbb *!*@31.129.223.97 *!*@64.185.106.163 *!*@31.41.92.68
* Ajnabi-Raste5636 was kicked by NoNStOp (Possibel/Spammer/Flooder)
* dil_meraroyetu_kia930 was kicked by NoNStOp (Possibel/Spammer/Flooder)
* p^H^O^O^L3672 was kicked by NoNStOp (Possibel/Spammer/Flooder)
* Joins: dave\mathews (~dave\math@37.59.77.39)
* dave\mathews was kicked by NoNStOp (Possibel/Spammer/Flooder)
<@Moody__Chatter> irctc886 don't offer trading
* NoNStOp sets mode: +b *!*@37.59.77.39
* Joins: SAJID5505 (~SAJID5505@5.102.56.133)
* alphabet71419 was kicked by CaNdY|MaN (You have been banned ( *!*@37.59.77.39 ~ by NoNStOp ) :: [Sun May 10 12:30:26 2015] - Banned ·193·)
* SAJID5505 was kicked by NoNStOp (Possibel/Spammer/Flooder)
* Joins: Woolcloth (~Woolcloth@host147-143-dynamic.48-82-r.retail.telecomitalia.it)
* Joins: Kooooooool7313 (~Koooooooo@103.11.23.2)
* NoNStOp sets mode: +b *!*@5.102.56.133
* Woolcloth was kicked by NoNStOp (Possibel/Spammer/Flooder)
* Joins: Hereislight (~Hereislig@195.208.151.61)
* ChanServ sets mode: +b *!*Hereislig@195.208.151.0/24
* Hereislight was kicked by ChanServ (User has been banned from the channel)
* Kooooooool7313 was kicked by NoNStOp (Possibel/Spammer/Flooder)
* Joins: taalash1746 (~taalash17@112.78.13.4)
* NoNStOp sets mode: +bb *!*@host147-143-dynamic.48-82-r.retail.telecomitalia.it *!*@103.11.23.2
* Joins: FromThisMomenton1217 (~FromThisM@111.68.99.59)
* NoNStOp sets mode: +M-k Possible.Flooder
* NoNStOp sets mode: +bbb *!*@195.208.151.61 *!*@112.78.13.4 *!*@111.68.99.59
* taalash1746 was kicked by CaNdY|MaN (You have been banned ( *!*@112.78.13.4 ~ by NoNStOp ) :: [Sun May 10 12:30:40 2015] - Banned ·194·)
* FromThisMomenton1217 was kicked by CaNdY|MaN (You have been banned ( *!*@111.68.99.59 ~ by NoNStOp ) :: [Sun May 10 12:30:40 2015] - Banned ·195·)
* NoNStOp sets mode: -Mk Possible.Flooder
This is ur script SpiKe^^ i change channel mode & kick reason.
( set rdsb(mode) "im" ) (set rdsb(mode) "M-k Possible.Flooder") if 3 user join in 10 secound with nickname match in ident bot lock channel mode ban all flooder from the channel... yEh that's what i ask for this look very nice to me thanks ... SpiKe^^ ..

but there is a litel problem bot does not remove the ban wich set i have to remove all the ban manualy... this is the same problem with multi-host-repeat.tcl v1.3 .. as well as multi-host-nick-flood.tcl v1.3 .. else no bugss or error on ur tcl works fine.. only this issue bot does not remove auto ban.. look at it if u have time .. thanks

F|irT...
[/b]
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

remove-damn-spam-bots.tcl v1.4 (13May2015) by SpiKe^^

Post by SpiKe^^ »

F|irT, try this version with the ban time setting working.
It should remove any bans it sets within 30 seconds of the ban expire time.

Code: Select all

## remove-damn-spam-bots.tcl v1.4 (13May2015) by SpiKe^^ ##


# Spam bots joins, kick-ban on joins:seconds #
set rdsb(flood) 3:10

# Spam bots joins kick-ban reason #
set rdsb(reasn) "Damn Spam Bot!"

# Max number of bans to stack in one mode command #
set rdsb(maxb) 6

# Length of time in minutes to ban damn spam bots #
# - set 0 to disable this script removing bans (ex. set rdsb(btime) 0) #
set rdsb(btime) 10

# After a valid damn spam bot join flood, script will continue #
# to kick-ban offenders for an additional 'x' seconds #
set rdsb(xpire) 10

# Set channel mode(s) on flood detected. #
# - set empty to disable setting channel modes (ex. set rdsb(mode) "") #
set rdsb(mode) "im"

# Remove these channel modes after how many seconds? #
set rdsb(mrem) 20

# END OF SETTINGS # Don't edit below unless you know what you're doing #

bind join - * rdsb_bindjoin

proc rdsb_bindjoin {nick uhost hand chan} {
  global rdsb rdsc rdsq

  if {[isbotnick $nick]} { return 0 }
  if {[matchattr $hand f|f $chan]} { return 0 }
  if {![string match "~*" $uhost]} { return 0 }

  set user [string range [lindex [split $uhost @] 0] 1 9]
  if {$user ne [string range $nick 0 8]} { return 0 }

  set uhost [string tolower $nick!$uhost]
  set chan [string tolower $chan]
  set utnow [unixtime]
  set target [lindex $rdsb(flood) 0]

  if {[info exists rdsc($chan)]} {
    set uhlist [lassign $rdsc($chan) cnt ut]
    set utend [expr {$ut + [lindex $rdsb(flood) 1]}]
    set expire [expr {$utend + $rdsb(xpire)}]
    if {$cnt < $target} {
      if {$utnow > $utend} { unset rdsc($chan) }
    } elseif {$utnow > $expire} { unset rdsc($chan) }
  }
  if {![info exists rdsc($chan)]} {
    set rdsc($chan) [list 1 $utnow $uhost]
    return 0
  }

  incr cnt
  if {$cnt <= $target} {
    if {[lsearch $uhlist $uhost] == -1} { lappend uhlist $uhost }
    if {$cnt < $target} {
      set rdsc($chan) [linsert $uhlist 0 $cnt $ut]
    } else {
      set rdsc($chan) [list $cnt $ut]
      if {$rdsb(mode) ne "" && [string is digit -strict $rdsb(mrem)]} {
        putquick "MODE $chan +$rdsb(mode)"
        utimer $rdsb(mrem) [list putquick "MODE $chan -$rdsb(mode)"]
      }
      rdsb_dobans $chan $uhlist
    }
    return 0
  }

  if {![info exists rdsq($chan)]} {
    utimer 2 [list rdsb_bque $chan]
    set rdsq($chan) [list $uhost]
  } elseif {[lsearch $rdsq($chan) $uhost] == -1} {
    lappend rdsq($chan) $uhost
  }

  if {[llength $rdsq($chan)] >= $rdsb(maxb)} {
    rdsb_dobans $chan $rdsq($chan)
    set rdsq($chan) ""
  } elseif {[botisop $chan]} { putquick "KICK $chan $nick :$rdsb(reasn)" }
  return 0
}

proc rdsb_dobans {chan uhlist} {
  global rdsb
  if {![botisop $chan]} return
  set banList ""
  set nickList ""
  foreach ele $uhlist {
    scan $ele {%[^!]!%[^@]@%s} nick user host
    set bmask "*!*@$host"
    if {[lsearch $banList $bmask] == -1} { lappend banList $bmask }
    if {[lsearch $nickList $nick] == -1} { lappend nickList $nick }
  }
  stack_bans $chan $rdsb(maxb) $banList
  foreach nk $nickList {
    if {[onchan $nk $chan]} { putquick "KICK $chan $nk :$rdsb(reasn)" }
  }


  if {$rdsb(btime) > 0} {
    set expire [expr {[unixtime] + $rdsb(btime)}]
    lappend rdsb(rmls) [list $expire $chan $banList]
  }

}

proc stack_bans {chan max banlist {opt +} } {
  set len [llength $banlist]
  while {$len > 0} {
    if {$len > $max} {
      set mode [string repeat "b" $max]
      set masks [join [lrange $banlist 0 [expr {$max - 1}]]]
      set banlist [lrange $banlist $max end]
      incr len -$max
    } else {
      set mode [string repeat "b" $len]
      set masks [join $banlist]
      set len 0
    }
    putquick "MODE $chan ${opt}$mode $masks"
  }
}

proc rdsb_bque {chan} {
  global rdsq
  if {![info exists rdsq($chan)]} { return }
  if {$rdsq($chan) eq ""} { unset rdsq($chan) ; return }
  rdsb_dobans $chan $rdsq($chan)
  unset rdsq($chan)
}

proc rdsb_breset {} {
  global rdsc rdsb
  set utnow [unixtime]
  set target [lindex $rdsb(flood) 0]
  foreach {key val} [array get rdsc] {
    lassign $val cnt ut
    set utend [expr {$ut + [lindex $rdsb(flood) 1]}]
    set expire [expr {$utend + $rdsb(xpire)}]
    if {$cnt < $target} {
      if {$utnow > $utend} { unset rdsc($key) }
    } elseif {$utnow > $expire} { unset rdsc($key) }
  }


  if {[info exists rdsb(rmls)]} {
    while {[llength $rdsb(rmls)]} {
      set next [lindex $rdsb(rmls) 0]
      lassign $next expire chan banList
      if {$expire > $utnow} {  break  }
      set rdsb(rmls) [lreplace $rdsb(rmls) 0 0]
      if {![info exists rmAra($chan)]} {  set rmAra($chan) $banList
      } else {  set rmAra($chan) [concat $rmAra($chan) $banList]  }
    }
    foreach {key val} [array get rmAra] {
      set banList ""
      foreach mask $val {
        if {![ischanban $mask $key]} {  continue  }
        lappend banList $mask
      }
      if {$banList eq ""} {  continue  }
      if {![botisop $key]} {
        set rdsb(rmls) [linsert $rdsb(rmls) 0 [list $utnow $key $banList]]
      } else {  stack_bans $key $rdsb(maxb) $banList -  }
    }
    if {![llength $rdsb(rmls)]} {  unset rdsb(rmls)  }
  }


  utimer 30 [list rdsb_breset]
}

if {![info exists rdsb_running]} {
  utimer 20 [list rdsb_breset]
  set rdsb_running 1
}

set rdsb(flood) [split $rdsb(flood) :]
set rdsb(btime) [expr {$rdsb(btime) * 60}]
if {$rdsb(btime)==0 && [info exists rdsb(rmls)]} {  unset rdsb(rmls)  }

putlog "Loaded remove-damn-spam-bots.tcl v1.4 by SpiKe^^"

Last edited by SpiKe^^ on Sun May 17, 2015 11:46 pm, edited 1 time in total.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
F
F|irT
Voice
Posts: 30
Joined: Thu Apr 30, 2015 11:23 pm
Location: Pakistan

The work Has been done...

Post by F|irT »

The thing i ask for that if ident match with nickname bot lock channel mode ban them from the channel .. is working fine, had issue with removing auto ban Now it has been Solve . Removing the ban is set ..

The tcl i request for is been compelled .. It's working proper & the result is very nice .


I like to Thanks Them all Site manage tcl maker helper & Especially To SpiKe^^" For making me fell so good. Thanks

F|irT..!
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Mass Join and Dam Spam bot same ?

Post by Fahad »

Is this TCL is different then " MASS JOIN FLOOD " ?

remove-damn-spam-bots.tcl v1.4
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Need Help Here !

Post by Fahad »

SpiKe^^

Why the bot keep setting -Rm after the flood ?

* SilentTwilight sets mode: -Rm
* SilentTwilight sets mode: -Rm
* SilentTwilight sets mode: -Rm
* SilentTwilight sets mode: -Rm
* SilentTwilight sets mode: -Rm
* SilentTwilight sets mode: -Rm
* SilentTwilight sets mode: -Rm
* SilentTwilight sets mode: -Rm
* SilentTwilight sets mode: -Rm
* SilentTwilight sets mode: -Rm
* SilentTwilight sets mode: -Rm
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

That's because the rdsb_bindjoin is triggered multiple times and thus it also executes

Code: Select all

utimer $rdsb(mrem) [list putquick "MODE $chan -$rdsb(mode)"] 
multiple times. Moving this to a different function where you check if the modes are set (or not) and remove them just once if it's the case, something like:

Code: Select all

proc rdsb_unlock {chan lock} {
	if {![botisop $chan]} return
	set cm [lindex [split [getchanmode $chan] +] 1]
	foreach m [split $lock ""] {
		if {[lsearch -exact $cm $m] != -1} {
			pushmode $chan -$m
		}
	}
}
and replace the above mentioned line with:

Code: Select all

utimer $rdsb(mrem) [list rdsb_unlock $chan $rdsb(mode)] 
Haven't tested anything so feedback is needed.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

Can you PLEASE give a FINAL CODE here. I don't want to make mistake this is most important TCL

Code: Select all

## mass-join-protection.tcl v1.6.1 (29Feb2016) by SpiKe^^ ## 


# Mass joins, kick-ban on joins:seconds # 
set mjp(flood) 3:2 

# Mass joins kick-ban reason # 
set mjp(reasn) "4M41ass 4J41oin 4F41lood" 

# Max number of bans to stack in one mode command # 
set mjp(maxb) 6 

# Max number of kicks to stack in one kick command #          <- NEW SETTING <- 
# NOTE: many networks allow more than one nick to be kicked per command. # 
#       set this at or below the max for your network. 
set mjp(maxk) 3 

# Length of time in minutes to ban mass join flooders # 
# - set 0 to disable this script removing bans (ex. set mjp(btime) 0) # 
set mjp(btime) 30 

# After a valid mass join flood, script will continue # 
# to kick-ban offenders for an additional 'x' seconds # 
set mjp(xpire) 10 

# Set the type of ban masks to use # 
#  1 = use host/ip specific bans (ex. *!*@some.host.com) # 
#  2 = use wide masked host/ip bans (ex. *!*@*.host.com) # 
#      note: setting 2 requires eggdrop 1.6.20 or newer. # 
set mjp(btype) 2 

# Set protected host(s) that should not be wide masked # 
# - Example:  set mjp(phost) "*.undernet.org" 
#  Note: this setting only applies to ban type 2 above! # 
#  Note: set empty to not protect any hosts (ex. set mjp(phost) "") # 
#  Note: space separated if listing more than one protected host # 
set mjp(phost) "" 

# Set channel mode(s) on flood detected. # 
# - set empty to disable setting channel modes (ex. set mjp(mode) "") # 
set mjp(mode) "Rm" 

# Remove these channel modes after how many seconds? # 
set mjp(mrem) 6000

# END OF SETTINGS # Don't edit below unless you know what you're doing # 

bind join - * mjp_bindjoin 

proc mjp_bindjoin {nick uhost hand chan} { 
  global mjp mjpc mjpq 

  if {[isbotnick $nick]} { return 0 } 
  if {[matchattr $hand f|f $chan]} { return 0 } 

  set uhost [string tolower $nick!$uhost] 
  set chan [string tolower $chan] 
  set utnow [unixtime] 
  set target [lindex $mjp(flood) 0] 

  if {[info exists mjpc($chan)]} { 
    set uhlist [lassign $mjpc($chan) cnt ut] 
    set utend [expr {$ut + [lindex $mjp(flood) 1]}] 
    set expire [expr {$utend + $mjp(xpire)}] 
    if {$cnt < $target} { 
      if {$utnow > $utend} { unset mjpc($chan) } 
    } elseif {$utnow > $expire} { unset mjpc($chan) } 
  } 
  if {![info exists mjpc($chan)]} { 
    set mjpc($chan) [list 1 $utnow $uhost] 
    return 0 
  } 

  incr cnt 
  if {$cnt <= $target} { 
    if {[lsearch $uhlist $uhost] == -1} { lappend uhlist $uhost } 
    if {$cnt < $target} { 
      set mjpc($chan) [linsert $uhlist 0 $cnt $ut] 
    } else { 
      set mjpc($chan) [list $cnt $ut] 
      if {$mjp(mode) ne "" && [string is digit -strict $mjp(mrem)]} { 
        putquick "MODE $chan +$mjp(mode)" 
        utimer $mjp(mrem) [list putquick "MODE $chan -$mjp(mode)"] 
      } 
      mjp_dobans $chan $uhlist 
    } 
    return 0 
  } 

  if {![info exists mjpq($chan)]} { 
    utimer 2 [list mjp_bque $chan] 
    set mjpq($chan) [list $uhost] 
  } elseif {[lsearch $mjpq($chan) $uhost] == -1} { 
    lappend mjpq($chan) $uhost 
  } 

  if {[llength $mjpq($chan)] >= $mjp(maxb)} { 
    mjp_dobans $chan $mjpq($chan) 
    set mjpq($chan) "" 
  } 

  return 0 
} 

proc mjp_dobans {chan uhlist} { 
  global mjp 
  if {![botisop $chan]} return 
  set banList "" 
  set nickList "" 
  foreach ele $uhlist { 
    scan $ele {%[^!]!%[^@]@%s} nick user host 


    if {$mjp(btype) == 2} { 
      set type 4 

      foreach ph $mjp(phost) { 
        if {[string match -nocase $ph $host]} { 
          set type 2  ;  break 
        } 
      } 

      set bmask [maskhost $ele $type] 

    } else {  set bmask "*!*@$host"  } 


    if {[lsearch $banList $bmask] == -1} { lappend banList $bmask } 
    if {[lsearch $nickList $nick] == -1} { lappend nickList $nick } 
  } 
  stack_bans $chan $mjp(maxb) $banList 

  # begin new kick code # 
  foreach nk $nickList { 
    if {[onchan $nk $chan]} {  lappend nkls $nk  } else { continue } 
    if {[llength $nkls] == $mjp(maxk)} { 
      putquick "KICK $chan [join $nkls ,] :$mjp(reasn)" 
      unset nkls 
    } 
  } 
  if {[info exists nkls]} { 
    putquick "KICK $chan [join $nkls ,] :$mjp(reasn)" 
  } 
  # end new kick code # 

  if {$mjp(btime) > 0} { 
    set expire [expr {[unixtime] + $mjp(btime)}] 
    lappend mjp(rmls) [list $expire $chan $banList] 
  } 
} 

proc stack_bans {chan max banlist {opt +} } { 
  set len [llength $banlist] 
  while {$len > 0} { 
    if {$len > $max} { 
      set mode [string repeat "b" $max] 
      set masks [join [lrange $banlist 0 [expr {$max - 1}]]] 
      set banlist [lrange $banlist $max end] 
      incr len -$max 
    } else { 
      set mode [string repeat "b" $len] 
      set masks [join $banlist] 
      set len 0 
    } 
    putquick "MODE $chan ${opt}$mode $masks" 
  } 
} 

proc mjp_bque {chan} { 
  global mjpq 
  if {![info exists mjpq($chan)]} { return } 
  if {$mjpq($chan) eq ""} { unset mjpq($chan) ; return } 
  mjp_dobans $chan $mjpq($chan) 
  unset mjpq($chan) 
} 

proc mjp_breset {} { 
  global mjpc mjp 
  set utnow [unixtime] 
  set target [lindex $mjp(flood) 0] 
  foreach {key val} [array get mjpc] { 
    lassign $val cnt ut 
    set utend [expr {$ut + [lindex $mjp(flood) 1]}] 
    set expire [expr {$utend + $mjp(xpire)}] 
    if {$cnt < $target} { 
      if {$utnow > $utend} { unset mjpc($key) } 
    } elseif {$utnow > $expire} { unset mjpc($key) } 
  } 

  if {[info exists mjp(rmls)]} { 
    while {[llength $mjp(rmls)]} { 
      set next [lindex $mjp(rmls) 0] 
      lassign $next expire chan banList 
      if {$expire > $utnow} {  break  } 
      set mjp(rmls) [lreplace $mjp(rmls) 0 0] 
      if {![info exists rmAra($chan)]} {  set rmAra($chan) $banList 
      } else {  set rmAra($chan) [concat $rmAra($chan) $banList]  } 
    } 
    foreach {key val} [array get rmAra] { 
      set banList "" 
      foreach mask $val { 
        if {![ischanban $mask $key]} {  continue  } 
        lappend banList $mask 
      } 
      if {$banList eq ""} {  continue  } 
      if {![botisop $key]} { 
        set mjp(rmls) [linsert $mjp(rmls) 0 [list $utnow $key $banList]] 
      } else {  stack_bans $key $mjp(maxb) $banList -  } 
    } 
    if {![llength $mjp(rmls)]} {  unset mjp(rmls)  } 
  } 

  utimer 30 [list mjp_breset] 
} 

if {![info exists mjp_running]} { 
  utimer 20 [list mjp_breset] 
  set mjp_running 1 
} 

set mjp(flood) [split $mjp(flood) :] 
set mjp(btime) [expr {$mjp(btime) * 60}] 
set mjp(phost) [split [string trim $mjp(phost)]] 
if {$mjp(btime)==0 && [info exists mjp(rmls)]} {  unset mjp(rmls)  } 

putlog "Loaded mass-join-protection.tcl v1.6.1 by SpiKe^^"
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

How hard is to add the rdsb_unlock code before the putlog line at the end of the script and replace the line I mentioned?
Once the game is over, the king and the pawn go back in the same box.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Thank you caesar
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Fahad
Op
Posts: 127
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

caesar wrote:How hard is to add the rdsb_unlock code before the putlog line at the end of the script and replace the line I mentioned?
Did you check the TCL which I paste you? and It will took 5 secs to replace.
Post Reply