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 

Bad-Nick script with stack bans.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
F|irT
Voice


Joined: 30 Apr 2015
Posts: 30
Location: Pakistan

PostPosted: Wed May 22, 2019 1:10 am    Post subject: Bad-Nick script with stack bans. Reply with quote

Code:

bind join - * join:badnick

proc join:badnick {nick host hand chan} {
   global botnick badnicks badnickchans badnickexempt badnicktime badnicktimer
   if {(([lsearch -exact [string tolower $badnickchans] [string tolower $chan]] != -1) || ($badnickchans == "*")) && ($nick != $botnick)} {
      foreach badnick [string tolower $badnicks] {
         set badnickban1 "*$badnick*!*@*"
         if {[string match *$badnick* [string tolower $nick]]} {
            if {([botisop $chan]) && (![isop $nick $chan]) && (![isvoice $nick $chan]) && (![matchattr $hand $badnickexempt $chan]) && ([onchan $nick $chan])} {
               putquick "MODE $chan +b $badnickban1"
               putquick "KICK $chan $nick :4Bad Nick 14Type /nick New-Nick 4& rejoin The Channel ."
               timer $badnicktime "pushmode $chan -b $badnickban1"
               return 0
            }
         }
      }
   }
}

This is bad nickname kicker working fine ... but when flooder join with ban nick bot make ban one by one .. it's possible to make bot ban max in the raw ... ..

like this ...
Code:

+bbbbb *!*@103.111.54.* *!*@103.73.225.* *!*@103.124.236.* *!*@103.117.228.* *!*@101.51.141.*
+bbbbbb *s*x*!*@* *pimp*!*@* *suck*!*@* ...

if any scripter help me kindly it will be gr8 help .. thanks..
Back to top
View user's profile Send private message Yahoo Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 602
Location: Tennessee, USA

PostPosted: Mon Jun 03, 2019 11:41 pm    Post subject: Reply with quote

Try this and let me know.

Code:

# advanced badnick script v. 0.1 by SpiKe^^ #

# list of badnicks #
set bnik(nicks) "sumbadword notherbadword"

# list badnick channel(s) or "*" for all channels #
set bnik(chans) "#sumChannel #notherChan"

# max number of bans to stack in one mode command (1 or more) #
set bnik(maxban) 6

# set seconds to wait before removing bans or 0 to not remove #
set bnik(btime) 30

# max number of kicks to stack in one kick command (1 or more) #
set bnik(maxkick) 3

# set the kick-ban reason #
set bnik(reasn) "\00304Bad Nick \00314Type: \002/nick New-Nick\002\00304 & rejoin the channel."

# set exempt userfile flags or "" for none #
set bnik(xflag) "bmno|o"

# exempt all users with +o in the channel ?? #
# ! this will add a brief delay (2 second minimum) ! #
#  0 = disabled: don't exempt users with +o #
#  1 = exempt all users with +o   #
#  2 = also exempt users with +v  #
set bnik(xops) 2

# set seconds to wait before checking the channel for +o or +v #
set bnik(otime) 2   ;# (0 = no delay) OR 2+ secs #

# set seconds to wait to gather a queue (1 or more) #
set bnik(qtime) 2



#### !End of Settings! !End of Settings! !End of Settings! ####
set bnik(nicks) [split [string tolower $bnik(nicks)]]
set bnik(chans) [split [string tolower $bnik(chans)]]
if {$bnik(xops)!=1 && $bnik(xops)!=2} { set bnik(xops) 0 }

bind join - * join:badnick

proc join:badnick {nk uh hn ch} {  global bnik bnop
  if {[isbotnick $nk]} { return }

  set ch [string tolower $ch]
  if {[lsearch -exact $bnik(chans) $ch] == -1 && $bnik(chans)!="*"} { return }
  if {$bnik(xflag)!="" && [matchattr $hn $bnik(xflag) $ch]} { return }

  foreach badnk $bnik(nicks) {
    if {[string match -nocase *$badnk* $nk]} {  set isbad $badnk  ;  break  }
  }
  if {![info exists isbad]} { return }

  set tid $ch,[unixtime]
  lappend bnop($tid) [string tolower $nk!$uh!$isbad]

  if {$bnik(otime)==0} {  check:badnick $tid
  } elseif {[llength $bnop($tid)]==1} {
    utimer $bnik(otime) [list check:badnick $tid]
  }
  return
}


proc check:badnick {tid} {  global bnik bnop bnqu
  lassign [split $tid ","] ch ut
  if {![info exists bnop($tid)]} { return }

  foreach nkuh $bnop($tid) {  lassign [split $nkuh "!"] nk uh isbad
    if {$bnik(xops)>0 && [isop $nk $ch]} { continue }
    if {$bnik(xops)>1 && [isvoice $nk $ch]} { continue }

    if {![info exists bnqu($ch)]} {
      utimer $bnik(qtime) [list queue:badnick $ch]
    }
    lappend bnqu($ch) $nkuh
  }
  unset bnop($tid)
}


proc queue:badnick {ch} {  global bnik bnqu
  if {![info exists bnqu($ch)]} { return }
  if {![botisop $ch]} { unset bnqu($ch) ; return }

  set banList ""  ;  set nickList ""
  foreach nkuh $bnqu($ch) {  lassign [split $nkuh "!"] nk uh isbad
    if {![onchan $nk $ch]} { continue }
    set bmask "*$isbad*!*@*"
    if {[lsearch $banList $bmask] == -1} { lappend banList $bmask }
    if {[lsearch $nickList $nk] == -1} { lappend nickList $nk }
  }
  unset bnqu($ch)

  set len [llength $banList]  ;  set max $bnik(maxban)
  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 $ch +$mode $masks"
    if {$bnik(btime) > 0} {
      utimer $bnik(btime) [list putquick "MODE $ch -$mode $masks"]
    }
  }

  set len [llength $nickList]  ;  set max $bnik(maxkick)
  while {$len > 0} {
    if {$len > $max} {
      set nicks [join [lrange $nickList 0 [expr {$max - 1}]] ,]
      set nickList [lrange $nickList $max end]
      incr len -$max
    } else {
      set nicks [join $nickList]
      set len 0
    }
    putquick "KICK $ch $nicks :$bnik(reasn)"
  }
}


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
simo
Master


Joined: 22 Mar 2015
Posts: 330

PostPosted: Wed Jun 05, 2019 3:30 am    Post subject: Reply with quote

i tested it somewhat it seems to not kick all stacked bans the stacked bans part seem to work fine tho
Back to top
View user's profile Send private message
Arnold_X-P
Op


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

PostPosted: Thu Sep 05, 2019 7:55 pm    Post subject: Reply with quote

hi SpiKe^^
interesting its writing but it would be good to also have an example warning set that warns 3 times and of bankick and that also recognizes the variant of nickname changes is to say that when the offender changes the nickname he still recognizes it and applies the warning set..

example; description; that the bot warns 2 times and the third one that ban kick /// if the set is 0 then it is direct ban when entering the channel
set warnings 3

it would be great if your writing has that already mentioned
set of warnings and nickname acknowledgments when you have changed to another nickname;
* symors (~Apna@181.115.129.223) has joined #beni2
* symors is now known as horny
eggdrop in channel; horny, change your nick please, 1 warning
eggdrop in channel; horny, if you don't change your nickname you will be ejected last warning.
in channel; * horny was kicked by eggdrop (sorry on this channel badnicks are not allowed)
or -----
* horny (~Apna@181.115.129.223) has joined #beni2
eggdrop in channel; horny, change your nick please, 1 warning
eggdrop in channel; horny, if you don't change your nickname you will be ejected last warning.
in channel; * horny was kicked by eggdrop (sorry on this channel badnicks are not allowed)
_________________
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
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