riham wrote:I have tested the Get_A_Fix's tcl but is not possible to set a ban time , the kick message and the the % of join & quit, but only the seconds before the quit.
The first tcl allprotections is really complicated to disable all is not simple, I try with #test# for disable some functions, but on rehash the bot give me error.
I'm not expert on modify the tcl script, but is possible in some tcl write for the join/part flood, change the part with the quit for to work it?
Thanks and salute
Firstly, riham, I think you've posted in the wrong thread. This thread is for a /whois script on an operbot. Secondly, because I'm not a moderator and am unable to move your question to the appropriate place, I'll just answer it here.
There are a couple of things you could use. For example, this script below will allow you to manage join/part and join/quit.
Code: Select all
# Commands: (these are available to Global OPs and Channel Master's and above)
# ---------
# !joinpart on|off
# !joinquit on|off
# /msg yourbot joinpart #channel on|off
# /msg yourbot joinquit #channel on|off
# Set global trigger to be used
set mytrig "!"
# Set time in seconds, for how long someone should have stayed joined, before they part or quit.
set jointime "10"
# ----- CODE BLOCK -----
proc getTrig {} {
global mytrig
return $mytrig
}
setudef flag joinpart
setudef flag joinquit
bind part - * join:part
bind sign - * join:quit
bind pub - ${pubtrig}joinpart joinpart:pub
bind pub - ${pubtrig}joinquit joinquit:pub
bind msg - joinpart joinpart:msg
bind msg - joinquit joinquit:msg
proc joinpart:pub {nick uhost hand chan arg} {
global botnick
if {[matchattr [nick2hand $nick] o|m $chan]} {
if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getTrig]joinpart on|off"; return}
if {[lindex [split $arg] 0] == "on"} {
if {[channel get $chan joinpart]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already enabled."; return}
channel set $chan +joinpart
puthelp "PRIVMSG $chan :Enabled JoinPart Protection for $chan"
return
}
if {[lindex [split $arg] 0] == "off"} {
if {![channel get $chan joinpart]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already disabled."; return}
channel set $chan -joinpart
puthelp "PRIVMSG $chan :Disabled JoinPart Protection for $chan"
return
}
}
}
proc joinquit:pub {nick uhost hand chan arg} {
global botnick
if {[matchattr [nick2hand $nick] o|m $chan]} {
if {[lindex [split $arg] 0] == ""} {putquick "PRIVMSG $chan :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: [getTrig]joinquit on|off"; return}
if {[lindex [split $arg] 0] == "on"} {
if {[channel get $chan joinquit]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already enabled."; return}
channel set $chan +joinquit
puthelp "PRIVMSG $chan :Enabled JoinQuit Protection for $chan"
return
}
if {[lindex [split $arg] 0] == "off"} {
if {![channel get $chan joinquit]} {putquick "PRIVMSG $chan :\037ERROR\037: This setting is already disabled."; return}
channel set $chan -joinquit
puthelp "PRIVMSG $chan :Disabled JoinQuit Protection for $chan"
return
}
}
}
proc joinpart:msg {nick uhost hand arg} {
global botnick
set chan [strlwr [lindex $arg 0]]
if {[matchattr [nick2hand $nick] o|m $chan]} {
if {[lindex [split $arg] 0] == ""} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick joinpart #channel on|off"; return}
if {[lindex [split $arg] 1] == ""} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick joinpart $chan on|off"; return}
if {[lindex [split $arg] 1] == "on"} {
if {[channel get $chan joinpart]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already enabled."; return}
channel set $chan +joinpart
putquick "NOTICE $nick :Enabled JoinPart Protection for $chan"
return
}
if {[lindex [split $arg] 1] == "off"} {
if {![channel get $chan joinpart]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already disabled."; return}
channel set $chan -joinpart
putquick "NOTICE $nick :Disabled JoinPart Protection for $chan"
return
}
}
}
proc joinquit:msg {nick uhost hand arg} {
global botnick
set chan [strlwr [lindex $arg 0]]
if {[matchattr [nick2hand $nick] o|m $chan]} {
if {[lindex [split $arg] 0] == ""} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick joinquit #channel on|off"; return}
if {[lindex [split $arg] 1] == ""} {putquick "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick joinquit $chan on|off"; return}
if {[lindex [split $arg] 1] == "on"} {
if {[channel get $chan joinquit]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already enabled."; return}
channel set $chan +joinquit
putquick "NOTICE $nick :Enabled JoinQuit Protection for $chan"
return
}
if {[lindex [split $arg] 1] == "off"} {
if {![channel get $chan joinquit]} {putquick "NOTICE $nick :\037ERROR\037: This setting is already disabled."; return}
channel set $chan -joinquit
putquick "NOTICE $nick :Disabled JoinQuit Protection for $chan"
return
}
}
}
proc join:part {nick uhost hand chan {msg ""}} {
global jointime
if {[channel get $chan joinpart]} {
set mask *!*@[lindex [split [getchanhost $nick $chan] @] 1]
set join [getchanjoin $nick $chan]
set part [unixtime]
set joinpart [expr $part - $join]
if {$joinpart <= $jointime} {
if {[botisop $chan] && ![validuser [nick2hand $nick]]} {
pushmode $chan +b $mask
}
}
}
}
proc join:quit {nick uhost hand chan reason} {
global jointime
if {[channel get $chan joinquit]} {
set mask *!*@[lindex [split [getchanhost $nick $chan] @] 1]
set join [getchanjoin $nick $chan]
set quit [unixtime]
set joinquit [expr $quit - $join]
if {$joinquit <= $jointime} {
if {[botisop $chan] && ![validuser [nick2hand $nick]]} {
pushmode $chan +b $mask
}
}
}
}
putlog ".:LOADED:. - JoinPart & JoinQuit - istok @ IRCSpeed"
Or, you could also use a method like this:
Code: Select all
# Command set via DCC/Telnet Partyline
# .chanset #channel flood-join joins:seconds (example: .chanset #IRCSpeed flood-join 4:2 - setting 4 joins in 2 seconds)
## Set the Lock Modes
# Bot will change channel mode to the modes you will specify below in case the bot will detect join flood
# To Disable Mode change set it to ""
set joinlockmodes "mR"
## Set the time in seconds to Unlock Modes (needed even if joinlockmodes are "")
# The Bot will Unlock the channel after the specified time you will set below
set unlocktime "45"
## Set the time in minutes to Unban (needed even if joinlockmodes are "")
# The Bot will Unban the user after the specified time you will set below
set unbantime "60"
# Set the Kick Message you would like, if the user(s) are still on Channel.
set kickmsg "\037J\037\002oin\002 \037F\037\002lood\002 \037D\037\002etected\002"
# 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 bantype 1
###########################
# CONFIGURATION ENDS HERE #
###########################
bind flud - join joinflood
proc joinflood {nick uhost hand type chan} {
global joinlockmodes unbantime unlocktime kickmsg
if {![botisop $chan] && [validuser [nick2hand $nick]] && [isop $nick $chan] && [isvoice $nick $chan]} {return}
set banmask [make:banmask $uhost $nick]
putquick "MODE $chan +$joinlockmodes"
pushmode $chan +b $banmask
putquick "KICK $chan $nick :$kickmsg."
utimer $unlocktime [list putquick "MODE $chan -$joinlockmodes"]
timer $unbantime [list pushmode $chan -b $banmask]
}
proc make:banmask {uhost nick} {
global bantype
switch -- $bantype {
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
}
}
putlog ".:LOADED:. JoinFlood.Check - istok @ IRCSpeed"
Allprotection.tcl is a huge script. It is rather bloated, but still gets the job done. I prefer to load specific scripts for specific events, and sometimes that can mean it reacts or triggers faster than bigger scripts like Allprotection.
You can use the top script, the bottom script, or all of it. It's up to you, and you may want to test which works best and stick with that.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.