Hello
Im running a quiz channel. But user sometime give me a hard time.
When some users dont know what the answer is, they can type "!hint" and bot gives them a hint. But to often user dont know when to stop, and channel looks like this:
!hint
!hint
!hint
!hint
!hint
So Im looking for a script that tempbans users with a message that they type to many "!hint" and get banned for like 3min.
This script would allow like, 3 * !hint every minut or so, from each user.
Is there any scripts like this, or anyone have the knowlegde to make sutch?
# add this at the top of the hint proc:
global hintFlood
scan $hintFlood(ratio) %i:%i times time
set now [clock sec]
if {[info exists hintFlood($uhost)]} {
set i 0
foreach ts $hintFlood($uhost) {if {$ts>$now} break; incr i}
if {$i} {
set hintFlood($uhost) [lrange $hintFlood($uhost) $i end]
} elseif {[llength $hintFlood($uhost)]==$times} {
puthelp "NOTICE $nick :Calm down.";# or ban or whatever...
return 1
}
}
lappend hintFlood($uhost) [incr now $time]
# outside the proc: (times:seconds)
set hintFlood(ratio) 3:60