Generally, when I try to work out a script I throw something like this together to keep my mind on what exactly I should be doing... Then I go through and put in the actual script and give it a few tests with some echo's or something...
on *:text:*:#: {
;if they broke the rules:
;check if on warn2
if yes:
;remove from warn2
;ban.
if no:
;check warn1
;check if on warn1
if yes:
;warn again
;remove from warn1
;add to warn2
if no warn
;warn
;add to warn1
}
You COULD use variables to keep users on the list, but I'd go with a file of some sort (txt would be easiest probably). Check if they broke the rules, if not then { return } If they did, then simply check if their username is in that file. If it is, do the appropriate action... I put in the "remove from..." bit just to prevent double messages and whatnot. But you could also just add a return after the "add to..." parts I think? Someone more knowledgeable might be able to verify if that would work. But, adding the remove also allows you to keep the files cleaned up a bit.
Also, this is just a quick thing I threw together. Obviously. Don't judge it for not checking the right way. The idea was to get you moving in the right direction.