Shoutbox

[request] send message to all online contacts - 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: [request] send message to all online contacts (/showthread.php?tid=62059)

[request] send message to all online contacts by ombadboy on 06-29-2006 at 09:32 PM

i was always thinkin of a script that u type in a message u want, and it sends it to all ONLINE contacts, whether you have their window open or not..


RE: [request] by qgroessl on 06-29-2006 at 09:33 PM

I think this is part of MP!L... I think it was in MP!3 anyway...

EDIT: Yeah... I guess it's only the opened chat windows that it does it for.... the /all command only sends to open chat windows.... It would be a cool script though.


RE: [request] send message to all online contacts by matty on 06-29-2006 at 09:50 PM

It is not hard to do but it would be a very slow process.

code:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage){
    if (sMessage.substring(0, 6) == '/imall'){
        var NewMessage = sMessage.substr(6);
        for(var enumerator = new Enumerator(Messenger.MyContacts) ; !enumerator.atEnd(); enumerator.moveNext()){
            var Contact = enumerator.item();
            if (Contact.Status != 1){
                ChatWnd = Contact.OpenChat(Contact.Email);
                ChatWnd.SendMessage(NewMessage);
                Interop.Call('user32', 'SendMessageW', ChatWnd.Handle, 0x10, 0, 0);
            }
        }
    }
}


You use this by saying /imall this is a message
RE: [request] send message to all online contacts by upsfeup on 06-29-2006 at 09:51 PM

Won't offline contacts also appear on the list?


RE: [request] send message to all online contacts by matty on 06-29-2006 at 09:52 PM

quote:
Originally posted by upsfeup
Won't offline contacts also appear on the list?
Oops my bad
RE: [request] send message to all online contacts by ombadboy on 06-29-2006 at 10:18 PM

hum.. seem to get an error that such cmd doesnt exist


RE: [request] send message to all online contacts by matty on 06-29-2006 at 10:23 PM

quote:
Originally posted by ombadboy
hum.. seem to get an error that such cmd doesnt exist
code:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage){
    if (sMessage.substring(0, 6) == '/imall'){
        var NewMessage = sMessage.substr(7);
        var ChatWnd;
        for(var enumerator = new Enumerator(Messenger.MyContacts) ; !enumerator.atEnd(); enumerator.moveNext()){
            var Contact = enumerator.item();
            if (Contact.Status != 1){
                ChatWnd = Contact.OpenChat(Contact.Email);
                ChatWnd.SendMessage(NewMessage);
                Interop.Call('user32', 'SendMessageW', ChatWnd.Handle, 0x10, 0, 0);
            }
        }
    }
}

Oops again, I seemed to have missed a line
code:
var ChatWnd;

RE: [request] send message to all online contacts by ombadboy on 06-29-2006 at 10:25 PM

same error :S


RE: [request] send message to all online contacts by upsfeup on 06-29-2006 at 10:28 PM

quote:
Originally posted by ombadboy
that such cmd doesnt exist
It doesn't say wich command?
RE: [request] send message to all online contacts by ombadboy on 06-29-2006 at 10:32 PM

the command you entered is not correct..


RE: [request] send message to all online contacts by upsfeup on 06-29-2006 at 10:40 PM

!!! You have to register it in the XML! ScriptInfo.xml

the way to not use the command is to change the first letter to ! instead of /

It will work the same, but it won't appear in the command list when you type "/"


RE: [request] send message to all online contacts by -dt- on 06-29-2006 at 10:44 PM

quote:
Originally posted by ombadboy
the command you entered is not correct..
quote:
Originally posted by upsfeup
!!! You have to register it in the XML! ScriptInfo.xml

the way to not use the command is to change the first letter to ! instead of /

It will work the same, but it won't appear in the command list when you type "/"
:-/ you dont have to register it in ScriptInfo.xml just change mattys code like



quote:
Originally posted by Matty

code:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage){
    if (sMessage.substring(0, 6) == '/imall'){
        var NewMessage = sMessage.substr(7);
        var ChatWnd;
        for(var enumerator = new Enumerator(Messenger.MyContacts) ; !enumerator.atEnd(); enumerator.moveNext()){
            var Contact = enumerator.item();
            if (Contact.Status != 1){
                ChatWnd = Contact.OpenChat(Contact.Email);
                ChatWnd.SendMessage(NewMessage);
                Interop.Call('user32', 'SendMessageW', ChatWnd.Handle, 0x10, 0, 0);
                return '';
            }
        }
    }
}


RE: [request] send message to all online contacts by upsfeup on 06-29-2006 at 10:50 PM

Your right! I forgot abou that detail!


RE: [request] send message to all online contacts by The Brain on 06-30-2006 at 01:24 AM

Shouldn't this line

code:
ChatWnd = Contact.OpenChat(Contact.Email);
be
code:
ChatWnd = Messenger.OpenChat(Contact);
?

That is the only OpenChat function I can find in the documentation, Contact doesn't have one.

That would make the whole script
code:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage){
    if (sMessage.substring(0, 6) == '/imall'){
        var NewMessage = sMessage.substr(7);
        var ChatWnd;
        for(var enumerator = new Enumerator(Messenger.MyContacts) ; !enumerator.atEnd(); enumerator.moveNext()){
            var Contact = enumerator.item();
            if (Contact.Status != 1){
                ChatWnd = Messenger.OpenChat(Contact);
                ChatWnd.SendMessage(NewMessage);
                Interop.Call('user32', 'SendMessageW', ChatWnd.Handle, 0x10, 0, 0);
                return '';
            }
        }
    }
}


It is a good script though, I was going to write something like this myself eventually, but now I don't have to!
RE: [request] send message to all online contacts by matty on 06-30-2006 at 06:04 AM

Ya I would have caught the error if I was at home working on it and not at work. I don't have access to either Live or MSN so its hard to debug the code I write at work and post.

But you are correct with the final script.


RE: [request] send message to all online contacts by ombadboy on 06-30-2006 at 08:46 AM

ure sure its workin? cuz its not quite working here..

it opens a window for a very small amount of time i cant notice, but it doesnt actually send what i type

edit: it seems only a portion of my contacts received the msg.. not all


RE: [request] send message to all online contacts by ombadboy on 07-05-2006 at 09:20 PM

bump.. can some1 help out? doesnt work..