You are describing two different things. What yo have is repeat protection, what your requesting is flood protection and I will give you an example for that.

I will provide you with an example that works for both channels and pm's as requested.

When someone talks, no matter what they say, we increase a variable with the nicks address, the cid and the window in the name by 1 unless it already is greater than the maximum number you set and tell it to unset in say 2 seconds. If the variable was greater than the number you set, say 10, you kick ban. That would mean if they said more than 4 lines in 2 seconds u kick/banned em. In the example below I also show how you could send warnings first.

To make the code functional simply replace the numbers to your liking and change the echo lines to whatever you want as well.
Code:
on *:text:*:#,?: {
  var %window $iif(!$chan,$nick)
  inc -u2 $+(%,$cid,.,$wildsite,.flood,.,%window) 1
  if $($+(%,$cid,.,$wildsite,.flood,.,%window),2) == 8 { echo -a Warning 1 }
  if $($+(%,$cid,.,$wildsite,.flood,.,%window),2) == 9 { echo -a Warning 2 }
  if $($+(%,$cid,.,$wildsite,.flood,.,%window),2) >= 10 { echo -a Actions }
}

Hope this helps.

Keep in mind that since you wanted it to do private messages and channels, you cant use /ban or even /kick because the pm isnt a channel and you cannot kick someone from it. What you would do is use seperate on text events for the pm and channels and then have the chan one kick/ban and the pm one /ignore and close the pm window or someting.

Good luck.

Last edited by Typos; 20/08/08 12:41 PM.