code:
var maxchars = 100;//Edit the maximum number of charaters here
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
if(Message.length >= maxchars)
Message = "I am stupid, and am trying to spam you";
return Message;
}
Not tested but should work fine