on *:JOIN:#: {
var %users 5
var %seconds 15
if (%on.join.flood.protector <= $calc(%users * %seconds)) {
inc %on.join.flood.protector %seconds
.timer %seconds 1 dec % $+ on.join.flood.protector
.
DO THE SCRIPT STUFF HERE
.
}
}
Max 5 users can join within 15 seconds, any more and the script takes no action.
var %users 5 sets the user count
var %seconds sets the seconds count
whats it do?
First is checks if a variable (%on.join.flood.protector) is less than or equal to "75" (5x15) which if its not then there has been more than 5 joins in the last 15 seconds.
Assuming there hasnt been then it adds 15 (seconds) to the var and sets off a timer to dec that var by 1 ever second for 15 seconds.
If it wasnt <= then dont do nothing as its the 6th join in 15 seconds
** joins beyond the 5th are not counted as joins, ie: if 5 join in 1 second, and then 13 more join 8 seconds later, 7 seconds following that, the join count is back to zero, because thats 15 seconds after the 5 joins that did count, (all others are ignored)
Simple, each time someone joins channel it adds "15" to a variable (%on.join.flood.protector)
next it sets off a timer
then if that variable is less than or quesal to "75" (5x15) then with in the last