Hello,
I need a script that sets mode +N when users change their nicks too fast and too often.
This mode should only set for 5 minutes...
Is that possible? This script stops "psyBNC-nick-change-bug"
Have u got an idea?
Big thx [R]
Code: Select all
bind nick - * scanner:nick
# Set limit
set flood_nc_limit 9
proc scanner:nick {nick uhost handle channel newnick} {
global flood_nc_limit NickChangeCount NickChangeTime
if {[info exists NickChangeTime($uhost)]} {
# If last nick change later than 3 minuts, forgetting...
if {[expr $NickChangeTime($uhost)+180] < [clock seconds]} {
set NickChangeCount($uhost) 0
}
}
set NickChangeTime($uhost) [clock seconds]
if {![info exists NickChangeCount($uhost)]} {
set NickChangeCount($uhost) 1
} else {
# 1 nick change more
incr NickChangeCount($uhost)
}
if {$NickChangeCount($uhost) >= $flood_nc_limit} {
# Limit reached. Putting +N
putserv "MODE $channel +N"
timer 5 "putserv \"MODE $channel -N\""
}
}
Code: Select all
# Set limit
set flood_nc_limit 9
bind nick - * scanner:nick
proc scanner:nick {nick uhost handle channel newnick} {
global flood_nc_limit NickChangeCount NickChangeTime
if {[info exists NickChangeTime]} {
# If last nick change later than 3 minuts, reset count...
if {[expr $NickChangeTime+180] < [clock seconds]} {
set NickChangeCount 0
}
}
set NickChangeTime [clock seconds]
if {![info exists NickChangeCount]} {
set NickChangeCount 1
} else {
# 1 nick change more
incr NickChangeCount
}
if {$NickChangeCount >= $flood_nc_limit} {
# Limit reached. Putting +N
putserv "MODE $channel +N"
timer 5 "putserv \"MODE $channel -N\""
}
}