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 

Join Part Flood Protection

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


Joined: 19 Sep 2020
Posts: 82

PostPosted: Thu Sep 01, 2022 6:15 am    Post subject: Join Part Flood Protection Reply with quote

Hello.
Can anyone please suggest me an affective Join/Part, Revolving Door Flood Protection TCL ? Who sets Like +bbbbb and sets Mode +R too.
This TCL is for DALNET.
Thanking already.
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Thu Sep 01, 2022 7:56 am    Post subject: Reply with quote

https://tclarchive.org/view.php?id=1171
_________________
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
Goga
Halfop


Joined: 19 Sep 2020
Posts: 82

PostPosted: Fri Sep 02, 2022 12:55 am    Post subject: Reply with quote

Dear CrazyCat,
I only require Join Part Flood Protecting, This TCL contains everything.
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Fri Sep 02, 2022 9:56 am    Post subject: Reply with quote

So disable other parts.
Or search by yourself on tclarchive.org
_________________
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
SpiKe^^
Owner


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

PostPosted: Fri Sep 02, 2022 11:24 am    Post subject: Reply with quote

Goga:
Try this forum thread...
http://forum.egghelp.org/viewtopic.php?t=21181
_________________
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
Goga
Halfop


Joined: 19 Sep 2020
Posts: 82

PostPosted: Sat Sep 03, 2022 12:07 am    Post subject: Reply with quote

Sir Spike,
I already tried this one in my EGGDROP on DALNET.
But I don't know why its not working on my side.
Back to top
View user's profile Send private message
SpiKe^^
Owner


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

PostPosted: Sat Sep 03, 2022 12:35 am    Post subject: Reply with quote

Plz explain "its not working on my side"

The code posted by simo seems fine to me:)
_________________
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
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Sat Sep 03, 2022 3:38 am    Post subject: Reply with quote

Thats because the original thread poster didn't include the entire code of the original author like the settings configuration and such

Original author : https://tclarchive.org/download.php?id=1141
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Sat Sep 03, 2022 4:30 am    Post subject: Reply with quote

Code:

# ####
# INFO
# ####
#
# joinpart.tcl v1.3 (Sep 10, 2005)
# edited by simo 3 sept 2022
#
# ###########
# DESCRIPTION
# ###########
#
# Channel Protection Script for Join/Part or Revolving Door Floods.
# BAN the IP's, Optional Banmask, Multiple Lock modes to protect channel from any sort of abusive message, as seen in join/part flood that clones send their messages during parting.
#
# ########
# FEATURES
# ########
#
# You can set channel lock modes, bansmask type, parting/revolving time period etc. depends on your channel situation,
# Set to invite only (+i) -OR- register only (+r on Undernet)/(+R on DALnet) -OR- Multiple modes (+mi/+mr) etc. to protect channel from continuous join/part and revolving door floods.
# By default, this script will ban those who part the channel after 3 seconds of joining with lock time of 8 seconds.
# you can change the settings as per your desire which is suitable for your channel.
#
# ############
# INSTALLATION
# ############
#
# * First unzip zipped file i.e. joinpart.zip file
# * Put joinpart.tcl file in your eggdrop "/scripts" folder
# * Add a link at the bottom of your eggdrop's .CONF file
#
#         source scripts/JoinPart-Flood.tcl
#
# * Save your bot's configuration
# * RESTART your bot -OR- do .rehash from the partyline (DCC) to load the tcl.
#
# #######
# UPDATES
# #######
#
# v1.0 - 01/04/2005 - Initial Release.
# v1.1 - 16/05/2005 - Bug Fixed: "Tcl error [ban:jp]: no such channel record"
# v1.2 - 22/06/2005 - Added: putlog.
# v1.3 - 10/09/2005 - Following;
#               o BAN Style
#               o BAN Time
#
# #######
# CONTACT
# #######
#
# Any suggestions, comments, questions or bugs,
# feel free to email me at:
#
#         fyre_tcls@yahoo.com
#
# fyre @ #Eggdrop & #RO-TCL
# On Undernet IRC Network
#
# #########
# DOWNLOADS
# #########
#
# This script and other good scripts/tcls can be found on:
#
# * http://www.egghelp.org/
# * http://www.tclscript.com/
#
# -REGARDS-

########################
#- Channel Activation -#
########################

# DCC/Partyline :  n|n .chanset   Use .chanset to activate the protections for the particular channel or not.
#       Example : .chanset #mychan1 +joinpart
#                 .chanset #mychan2 -joinpart


#########################
#- Part/Revolving Time -#
#########################

# Set time period (in seconds) that how long did nick stay in channel before parting.
set jp(part) 2

###############
#- Lock Mode -#
###############

# Set channel modes which you want to be use for locking in join/part or revolving door floods,
# Leave blank "" if you dont like to set modes.
set jp(lock_modes) "R"

##############
#- BAN Type -#
##############

# Set the banmask type to use in banning the join/part or revolving door floods.
# Currently BAN Type is set to 1 (*!*@some.domain.com),
# BAN Types are given below;
# 1 - *!*@some.domain.com
# 2 - *!*@*.domain.com
# 3 - *!*ident@some.domain.com
# 4 - *!*ident@*.domain.com
# 5 - *!*ident*@some.domain.com
# 6 - *nick*!*@*.domain.com
# 7 - *nick*!*@some.domain.com
# 8 - nick!ident@some.domain.com
# 9 - nick!ident@*.host.com
set jpban_type 2

###############
#- Lock Time -#
###############

# Set time period (in seconds) that how much time it takes to do unlock after join/part flood.
set jp(unlock) 300

#####################
#- Kick/BAN Reason -#
#####################

# Set kick/ban reason here.
set jp(reason) "Part/Revolving Door Flood Detected"


###############
#- BAN Style -#
###############

# Set the punishment style/method you want to use to ban flooders.
# Select BAN Style from the following;
# 1 - Server Ban  (set ban on the channel)
# 2 - Channel Ban (set ban in bot's internal banlist on specific channel)
# 3 - Global Ban  (set ban in bot's internal banlist for every channel)
set jp(style) "1"

##############
#- BAN Time -#
##############

# Leave blank "" if you select style 1 in "BAN Style",
# If you select "BAN Style" 2 or 3 above, then set ban time in minutes, 0 for permanent ban.
set jp(btime) "10"


########################################################
#- Don't edit below unless you know what you're doing -#
########################################################



######## i added Public Command to enable/disable ###########
# Syntax : !jp on/off

bind PUB n !jp JoinPart:Flood


 

setudef flag joinpart

proc JoinPart:Flood {nick uhost hand chan arg} {

  switch -nocase -- [lindex [split $arg] 0] {
    on {
      if {[channel get $chan joinpart]} {
        putserv "NOTICE $nick :anti-joinpart is already enabled on $chan."
      } else {
        channel set $chan +joinpart
        putserv "NOTICE $nick :anti-joinpart is now enabled."
}
    }
    off {
      if {![channel get $chan joinpart]} {
        putserv "NOTICE $nick :anti-joinpart is already disabled on $chan."
      } else {
        channel set $chan -joinpart
        putserv "NOTICE $nick :anti-joinpart is now disabled."
     }
    }   
  }
}




 
bind part - * ban:jp

proc ban:jp {nick uhost hand chan arg} {
  global jp botnick jpchan kickcount logo
 
   if {[string match -nocase "*@*irccloud*" $uhost]} { return 0 }


  if {[isbotnick $nick] || ![botisop $chan] || ![channel get $chan joinpartflood]} {
    return
  }
  if {![info exists jpchan($chan)]} {
    set jpchan($chan) 0
  }
  if {[matchattr $hand b] || [matchattr $hand fom|fom $chan]} {
    return
  }
  if {[getchanjoin $nick $chan] >= [expr {[clock seconds]-$jp(part)}]} {

 
         set Lockreason "Join/Part-detected"
         jp:lockchan $chan "Join/Part-Flood"
      
    if {$jp(style) == "1"} {
   set banmask [jp:banmask $uhost $nick]
       pushmode $chan +b $banmask
      putserv "KICK $chan $nick :$jp(reason) $kickcount $logo"
      putlog "JoinPart: Flood Attempt on $chan ($banmask) banned on the channel"
    }
    if {$jp(style) == "2"} {
   set banmask [jp:banmask $uhost $nick]
      pushmode $chan +b $banmask   
      putserv "KICK $chan $nick :$jp(reason) $kickcount $logo"
      putlog "JoinPart: Flood Attempt on $chan ($banmask) added in the channel banlist"
      newchanban "$chan" "$banmask" "JoinPart" "$jp(reason)" "$jp(btime)"
    }
    if {$jp(style) == "3"} {
    set banmask [jp:banmask $uhost $nick]
      pushmode $chan +b $banmask
      putserv "KICK $chan $nick :$jp(reason) $kickcount $logo"
      putlog "JoinPart: Flood Attempt on $chan ($banmask) added in the global banlist"
      newban "$banmask" "JoinPart" "$jp(reason)" "$jp(btime)"
    }
    flushmode $chan
  }
}


proc jp:banmask {uhost nick} {
 global jpban_type
  switch -- $jpban_type {
   1 { set banmask "*!*@[lindex [split $uhost @] 1]" }
   2 { set banmask "*!*@[lindex [split [maskhost $uhost] "@"] 1]" }
   3 { set banmask "*!*$uhost" }
   4 { set banmask "*!*[lindex [split [maskhost $uhost] "!"] 1]" }
   5 { set banmask "*!*[lindex [split $uhost "@"] 0]*@[lindex [split $uhost "@"] 1]" }
   6 { set banmask "*$nick*!*@[lindex [split [maskhost $uhost] "@"] 1]" }
   7 { set banmask "*$nick*!*@[lindex [split $uhost "@"] 1]" }
   8 { set banmask "$nick![lindex [split $uhost "@"] 0]@[lindex [split $uhost @] 1]" }
   9 { set banmask "$nick![lindex [split $uhost "@"] 0]@[lindex [split [maskhost $uhost] "@"] 1]" }
   default { set banmask "*!*@[lindex [split $uhost @] 1]" }
   return $banmask
  }
}

proc jp:lockchan {chan LockReason} {
global joinpart_flooded lock_channel jp
    if {![info exists joinpart_flooded($chan)]} {
    set joinpart_flooded($chan) 1
    putnow "MODE $chan +R-k ${LockReason}"
   utimer $jp(unlock) [list putquick "MODE $chan -$jp(lock_modes)k ${LockReason}-Unlocked"]
    utimer 10 [list unset -nocomplain ::joinpart_flooded($chan)]
  }
}


 
 
#############################################################
putlog "LOADED: Part/Revolving Door Flood Protection by fyre"
#############################################################

Back to top
View user's profile Send private message
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