just use a little hash table or something, you just need to use the raw events for away on your server:

raw <away numeric>:*:{
hadd -mu5 away.flood.prot $nick $calc($hget(away.flood.prot,$nick) + 1)
if ($hget(away.flood.prot,$nick) >= 3) {
<insert your ban tag here>
<insert your kick tag and message here>
}
}


raw <back numeric>:*:{
hadd -mu5 return.flood.prot $nick $calc($hget(return.flood.prot,$nick) + 1)
if ($hget(return.flood.prot,$nick) >= 3) {
<insert your ban tag here>
<insert your kick tag and message here>
}
}


something like that will suffice just fine, you could always use variable instead, but they're more hassle then you need, and just replace the <tags> with the appropriate data/information and it should work fine, or will work fine with a little "playing" with wink..... good enough for just a quick example (Y)