I made a script way-back-when. I'll post it here because it's slightly relevant.

Quote:
on *:TEXT:*:#: {
;#### ROBOT BOUNCER ####
if (%BouncerOn == True) {
if (%AmHuman. [ $+ [ $nick ] ] == $null) {
set %AmHuman. [ $+ [ $nick ] ] False
}
if (%RaidCountdown <= 0 && %AmHuman. [ $+ [ $nick ] ] == False) {
if (%BotWarningCount. [ $+ [ $nick ] ] >= 5) {
msg $chan /ban $nick
msg $chan /me &#10071; $nick [ $+ [ , ] ] message @KubosKube with "/w KubosKube Unban $nick $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) " to be unbanned. Robots won't follow these directions.
set %BotWarningCount. [ $+ [ $nick ] ] 0
}
else {
if (%BotWarningCount. [ $+ [ $nick ] ] == $null) {
set %BotWarningCount. [ $+ [ $nick ] ] 0
}
inc %BotWarningCount. [ $+ [ $nick ] ]
msg $chan /me &#10071; Type !human in Chat, $nick . Warning %BotWarningCount. [ $+ [ $nick ] ] / 5.
}
}
}
}


It uses a couple of variables.
%BouncerOn is a toggle so I can turn this feature off.
%AmHuman "determines" if a user is a robot or not. If this value is false, then the user is "breaking the rules".
%BotWarningCount.$nick is used for counting how many times a particular user has been warned. When this reaches a certain limit, it bans the user.
%RaidCountDown is set in a separate part of my script to bypass this whole block of text so I don't timeout/ban 20 new members in my Twitch stream during a raid.

I know it's not exactly what you asked for, but it's close to what you wanted, I think, so I hope it helps you out.