What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Need a counter for a specific contact

Need a counter for a specific contact
Author: Message:
chadchoud
New Member
*


Posts: 3
Joined: Sep 2008
O.P. Need a counter for a specific contact
Well I'm checking bad words from users.

code:
times = 0;
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
    var Contacts = ChatWnd.Contacts;
    var e = new Enumerator(Contacts);
    var Contact = e.item();
    if (Message == "some bad word here") {
        times = times + 1;
        MsgPlus.DisplayToast("Look man", Origin + " sent a bad word");
        ChatWnd.SendMessage("This is your warning number: " + times);
        if (times == 1) {
            ChatWnd.SendMessage("One more time and you'll be blocked.");
        }
        else if (times >= 2) {
            Contact.Blocked = true;
        }
    }
}

Ok my problem is with the global variable. Say contact X says this bad word, then contact Y says it, Y gets blocked because times gets equal 2 at Y's message. What I need to know is if it' possible fr every contact to hold its own counter.

Sorry if my idea is a bit noob, but it will let me understand other concepts.

Thank you.
09-18-2008 08:04 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Need a counter for a specific contact - by chadchoud on 09-18-2008 at 08:04 PM
RE: Need a counter for a specific contact - by MeEtc on 09-18-2008 at 08:17 PM
RE: RE: Need a counter for a specific contact - by chadchoud on 09-18-2008 at 08:19 PM
RE: Need a counter for a specific contact - by MeEtc on 09-18-2008 at 08:30 PM
RE: Need a counter for a specific contact - by chadchoud on 09-18-2008 at 08:56 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On