Soon I modified the 3600 for - > 60 - > but he did not function5 { set threshold [expr [clock seconds] - $banlist(hours) * 3600]
set chanbanlist
- foreach ban [chanbans $chan] {
if {$threshold > [lindex $ban 2]} {
lappend chanbanlist $ban
}
}
if {[string is integer $banlist(remove)]} {
set chanbanlist [lrange $chanbanlist 0 [expr $banlist(remove) - 1]]
}
}
how I can modify the time of hours for minutes?#Set the type of channels you would like this script to work on.
#USAGE: [1/2] (1=USER DEFINED CHANNELS, 2=ALL CHANNELS)
#Setting '1' only checks banlists of channels which are defined for the script (in the next setting)
#Setting '2' checks banlists of all the channels the bot is on
set banlist(chantype) "1"
###SET THIS ONLY IF YOU HAVE SET THE PREVIOUS SETTING TO '1'###
#Set the channels here on which the script would work. Each channel should be separated by a space.
#USAGE: set banlist(chanlist) "#channel1 #channel2 #channel3"
set banlist(chanlist) "#Age_of_Empires_2"
#Set this to the 'number' of bans you will allow in the channel banlist. If the number
#of bans exceeds this number then bans will be removed based on your settings below.
######################################################################################
#REMEMBER: This number should NOT be more than your IRC network's banlist capacity.
#To find this number, see 'MAXBANS' setting on connection to your irc server.
#(If you are not aware contact your local friendly irc operator and find out)
#Example: DALnet currently has 200.
set banlist(max) ""
#Set the METHOD in which you would like to remove the channel bans. The number
#of bans to be removed will be based on the value set above.
#USAGE: [1/2/3/4/5/6] (1=RANDOM, 2=RECENT, 3=LAST, 4=BY BOT, 5=OLDER THAN, 6=ALL)
#################################################################################
#Use '1' If you want to remove bans randomly.
#Use '2' If you want to remove recently placed bans.
#Use '3' If you want to remove last placed bans.
#Use '4' If you want to remove bans only placed by the bot.
#Use '5' If you want to remove bans older than a specific number of hour(s).
#Use '6' If you want to remove all bans from the channel.
set banlist(type) "5"
#Set the 'number' of bans to remove when the bans in the channel banlist reaches more
#than 'banlist(max)', which you set above in the first setting of the script.
#USAGE: 'Any number' ==> removes a number of bans
#USAGE: 'all' ==> removes all channel bans (only valid for banlist method 4 and 5)
#####################################################################################
###If this setting is set to 'ALL'###
#For banlist method 4: All bans placed by the bot will be removed
#For banlist method 5: All bans older than specific hour(s) defined will be removed
set banlist(remove) "all"
###SET THIS ONLY IF YOU HAVE SET THE PREVIOUS SETTING TO '5'###
#Set the time here in 'hour(s)' after which you would like to remove the bans.
#Bans placed before this specified number of hour(s) will be removed.
set banlist(hours) "2"
#----------------------------------------#
# SET BANLIST NOTIFICATION OPTIONS #
#----------------------------------------#
#Set this if you want to send an OPNOTICE to the channel ops when removing the bans.
#USAGE [0/1] (0=OFF, 1=ON)
set banlist(onotice) "0"
#---------------------------------#
# SET BANLIST ON JOIN CHECK #
#---------------------------------#
#Set the time here in 'minutes' to check the banlist for removing bans. This
#will be initiated after the bot joins a channel, typically after a restart.
set banlist(delay) "1"
##############################################################################
### Don't edit anything else from this point onwards even if you know tcl! ###
##############################################################################
bind join - "*" banlistjoin
bind mode - "*" banlistmode
set banlist(auth) "\x61\x77\x79\x65\x61\x68"
set banlist(ver) "v8.96.b"
proc banlistjoin {nick uhost hand chan} {
global banlist
if {![isbotnick $nick]} { return 0 }
if {($banlist(chantype) == "1") && ([lsearch -exact [split [string tolower $banlist(chanlist)]] [string tolower $chan]] == -1)} { return 0 }
timer $banlist(delay) [list banlistmode $nick $uhost $hand $chan +b join]
}
proc banlistmode {nick uhost hand chan mode target} {
global banlist
if {[string is integer $banlist(remove)] && ($banlist(remove) > $banlist(max))} { return 0 }
if {($banlist(chantype) == "1") && ([lsearch -exact [split [string tolower $banlist(chanlist)]] [string tolower $chan]] == -1)} { return 0 }
if {[string equal "+b" $mode] && [botisop $chan]} {
if {[llength [chanbans $chan]] >= $banlist(max)} {
set banlist(notc1) "Channel banlist currently contains $banlist(max) entries"
switch -exact $banlist(type) {
1 { set chanbanlist [chanbans $chan] }
2 { set chanbanlist [lsort -index 2 -integer -increasing [chanbans $chan]] }
3 { set chanbanlist [lsort -index 2 -integer -decreasing [chanbans $chan]] }
4 { set chanbanlist
- foreach ban [chanbans $chan] {
if {[string equal -nocase [lindex [split [lindex $ban 1] !] 0] $botnick]} {
lappend chanbanlist $ban
}
}
if {[string is integer $banlist(remove)]} {
set chanbanlist [lrange $chanbanlist 0 [expr $banlist(remove) - 1]]
}
}
5 { set threshold [expr [clock seconds] - $banlist(hours) * 3600]
set chanbanlist
- foreach ban [chanbans $chan] {
if {$threshold > [lindex $ban 2]} {
lappend chanbanlist $ban
}
}
if {[string is integer $banlist(remove)]} {
set chanbanlist [lrange $chanbanlist 0 [expr $banlist(remove) - 1]]
}
}
6 { if {$banlist(onotice) == "1"} {
putserv "NOTICE @$chan :$banlist(notc1). Clearing the entire channel banlist."
}
resetbans $chan
return 0
}
default { return 0 }
}
if {$banlist(type) == "5"} {
if {[llength $chanbanlist] > 0} {
if {$banlist(onotice) == "1"} {
if {[string is integer $banlist(remove)]} {
putserv "NOTICE @$chan :$banlist(notc1). Removing $banlist(remove) bans older than $banlist(hours) hours."
} elseif {[string equal -nocase "all" $banlist(remove)]} {
putserv "NOTICE @$chan :$banlist(notc1). Removing all bans older than $banlist(hours) hours."
}
}
if {[llength $chanbanlist] > 0} {
foreach ban $chanbanlist { pushmode $chan -b [lindex $ban 0] }
flushmode $chan; return 0
}
}
} elseif {[string is integer $banlist(remove)] && [regexp {^[1-4]$} $banlist(type)]} {
set chanbanlist [lrange $chanbanlist 0 [expr $banlist(remove) - 1]]
if {$banlist(onotice) == "1"} {
switch -exact $banlist(type) {
1 { set banlist(notc2) "Removing $banlist(remove) bans randomly from the banlist." }
2 { set banlist(notc2) "Removing the recent $banlist(remove) bans placed." }
3 { set banlist(notc2) "Removing the last $banlist(remove) bans placed." }
4 { set banlist(notc2) "Removing [string tolower $banlist(remove)] bans placed by the bot." }
}
putserv "NOTICE @$chan :$banlist(notc1). $banlist(notc2)"
}
if {[llength $chanbanlist] > 0} {
foreach ban $chanbanlist { pushmode $chan -b [lindex $ban 0] }
flushmode $chan; return 0
}
}
}
}
}
if {![string equal "\x61\x77\x79\x65\x61\x68" $banlist(auth)]} { set banlist(auth) \x61\x77\x79\x65\x61\x68 }
putlog "Channel Banlist Cleaner $banlist(ver) by $banlist(auth) has been loaded successfully."
Thanks !!