kilouco,
May I strongly note that using such a script must be done in a very carefull way...
Who says that the long message your contact is sending you is some crap text? The contact might very well enter some very senseable question or whatever to you and you wouldn't know it. And your contact wouldn't know it either.
Bottom line: this is not a solution to your problem.
The solution is a decent anti-spam script which might block your contact if he/she sends to much lines after each other in a given amount of time. That is how anti-spam work in practice.
Something like this will only get you in more trouble, it will not solve your crashing problem (since Messenger still recieves the long messages anyways internally) and you _will_ missing probably stuff said by contacts who did not had the intention to spam you at all...
--------------------
quote:
Originally posted by Felu
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
It will not work at all since it is far from as simple as that I'm afraid. A decent anti-spam script requires timers (individual for each contact who msgs you), should be polygamy aware, should block contacts, (automatically) unblock them, etc.