Yes there is, check this out:
Quote:

var %i = 0
on *:text:*word*:#:{
inc %i
If (%i > 3) {
/msg $chan Calm down lads!
set %i 0
}
}