Hi! I've been around already searching for this kind of script but wasn't able to find it. Anyway,here's how this script will work:
<[nick]> Line1
<[nick]> Line2
<[nick]> Line3
<[nick]> Line4
<[nick]> Line5
<[nick]> Line6
* Bot sets mode: +b [nick]!*ident@some.host.com
<Bot> We need to restrain you for 2minutes (6lines in 2seconds)
As you can see the nick has typed words/phrases 6 lines in 2 seconds and that puts him in a mute state for 2 mins. And he will be unmuted after 2 mins. I don't want a script that will kick/ban any user that has violated a flood rule. I just want him/her to be muted.
Hoping for a kind consideration on my request. TYIA.
Ok..Found this code somewhere in the thread..Can someone kindly edit this please? The bot should not kick the user but just ban him for 2 minutes and that ban will place him in mute state where he cannot send message to the main channel.
# actban variable is setting ban time
# use 0 to make perm
set actban 2
bind pubm - "*" ban:act
proc ban:act { nick uhost hand dest key text } {
#uncomment next line to exclude chanops
#if [!isop $nick] return
newban *!*$uhost $::botnick action_ban $::actban
}
This works but need some additional info like it will only ban for 2 minutes then unban after 2 minutes. It should detect the 6 lines in 2 seconds messages/phrases the user has typed. And it should also display a message on the channel like:
<Bot> We need to restrain you for 2minutes (6lines in 2seconds)
set time ""
set counter 1
set floodnick ""
pind pubm - * flood:pub
proc flood:pub {nick uhost hand chan text} {
global time counter floodnick
if {[expr [clock seconds]-$::uptime]<=$time && $nick == $floodnick} {
incr counter 1; set floodnick $nick
if {$counter > 5} {newban $nick!*$uhost $::botnick ban 2; set counter 0}
}
set time [expr [expr [clock seconds]-$::uptime] + 2]; set counter 1; set floodnick $nick
}
Last edited by game_over on Mon Nov 24, 2008 5:13 am, edited 1 time in total.