Shoutbox

Script Help! - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Script Help! (/showthread.php?tid=87693)

Script Help! by leetking on 12-11-2008 at 04:53 PM

Hello,
I just started to write some script.
I have already my first question: How can I make a new line writing a text?
My Script:

iOriginWnd.SendMessage("Test1
Test2");

This doesnt work! Is there any special command for that?
(It shouldnt write 2x, like:
iOriginWnd.SendMessage("Test1");
iOriginWnd.SendMessage("Test2");




Question Number 2:

I want that when contacts say "you are dumb" that it will be hided. How I do this? (So I won't receive that message)


Question Number 3:

I want the thing from number 2 only work for 2 contacts. How can I check their email with a script?


RE: Script Help! by matty on 12-11-2008 at 05:56 PM

jscript code:
OriginWnd.SendMessage("Test1\nTest2");

RE: RE: Script Help! by leetking on 12-11-2008 at 06:04 PM

quote:
Originally posted by matty
jscript code:
OriginWnd.SendMessage("Test1\nTest2");


Thank you, it works!
What about the other things?
RE: Script Help! by matty on 12-11-2008 at 06:17 PM

jscript code:
function OnEvent_ChatWndReceiveMessage (oChatWnd, sOrigin, sMessage, nMessageKind) {
    for (var oContact = new Enumerator(oChatWnd.Contacts); !oContact.atEnd(); oContact.moveNext()) {
        if (oContact.item().Email === 'johndoe@hotmail.com' && sMessage.toLowerCase() === 'you are dumb') {
            sMessage = '';
        }
    }
}

RE: Script Help! by leetking on 12-11-2008 at 06:36 PM

I got now this:

jscript code:
function OnEvent_ChatWndReceiveMessage(oChatWnd, sOrigin, sMessage, nMessageKind) {
    for (var oContact = new Enumerator(oChatWnd.Contacts); !oContact.atEnd(); oContact.moveNext()) {
        if (oContact.item().Email === 'contact_email@hotmail.com') {
        if(sMessage=="!test"){
        oChatWnd.SendMessage("it works");}
        }
    }
}

It works fine, but, it also works for me now. How can I change it so it will only work for my contact?
RE: Script Help! by roflmao456 on 12-11-2008 at 09:20 PM

check if sOrigin doesn't equal your display name :P