What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » sending a message to all my contacts

Pages: (2): « First [ 1 ] 2 » Last »
sending a message to all my contacts
Author: Message:
gregrj
Junior Member
**


Posts: 20
Joined: Feb 2011
O.P. sending a message to all my contacts
Hi
Is there a way to send a personal message to every contact in my messenger online AND offline ?

I'm changing my ID, and I would like to notify the maximum of them.

I didn't found any option inlive msg, neither in msg +, and no more in the scripts...

has anyone seen a solution for that ?

Thank you

This post was edited on 07-04-2012 at 02:09 PM by gregrj.
07-04-2012 01:57 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
36 / Male / Flag
Joined: Dec 2002
Status: Away
RE: sending a message to all my contacts
Without testing...

Javascript code:
var oContacts = [];
var Message = 'This is where your message would go.';
 
function OnEvent_Initialize() {
    OnEvent_SigninReady();
}
 
function OnEvent_SigninReady() {
    if (Messenger.MyStatus < STATUS_INVISIBLE) return false;
   
    for (var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext())
        oContacts.push(e.item())
       
    MsgPlus.AddTimer('', 60000); // Run every minute
}
 
function OnEvent_Timer() {
    var bSent = true;
    var oChatWnd;
    while (bSent === true && oContacts.length > 0) {
        oChatWnd = Messenger.OpenChat(oContacts[0]);
        if (oChatWnd.EditChangeAllowed === true) // Can we send a message?
            bSent = oChatWnd.SendMessage(Message); // Store the result in a variable incase we've hit the flood protection
           
            Interop.Call('user32', 'SendMessageW', oChatWnd.Handle, 0x10 /* WM_CLOSE */, 0) // Close the window regardless
           
            if (bSent === true) // Was the message sent correctly?
                oContacts.shift(); // Drop the first element of the array
            else
                if (oContacts.length > 0)
                    MsgPlus.AddTimer('', 60000); // Run every minute
    }
}


This post was edited on 07-04-2012 at 02:20 PM by matty.
07-04-2012 02:19 PM
Profile E-Mail PM Find Quote Report
gregrj
Junior Member
**


Posts: 20
Joined: Feb 2011
O.P. RE: sending a message to all my contacts
Thank you !

Is this a script who checks every minutes who is online to send a message to them ?

and is this part :
if (bSent === true) // Was the message sent correctly?
code:
                oContacts.shift(); // Drop the first element of the array
prevent from sending multiple msg tto the same person ?


Well anyway, the question is : I just "launched it" how could I check that it's working ??

(sorry for my awful English, I'm French by the way)
07-04-2012 05:07 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
36 / Male / Flag
Joined: Dec 2002
Status: Away
RE: sending a message to all my contacts
quote:
Originally posted by gregrj
Is this a script who checks every minutes who is online to send a message to them ?
No. You are limited to the number of messages you can send through Messenger Plus! (internal flood protection) per minute. Therefore every minute it will try and send another batch of messages until there are no longer contacts in the list.
quote:
Originally posted by gregrj
prevent from sending multiple msg tto the same person ?
Yes
quote:
Originally posted by gregrj
ell anyway, the question is : I just "launched it" how could I check that it's working ??
Enable script debugging in the preferences and if there are any errors let me know. I didn't test it just wrote the script.
07-04-2012 05:13 PM
Profile E-Mail PM Find Quote Report
gregrj
Junior Member
**


Posts: 20
Joined: Feb 2011
O.P. RE: sending a message to all my contacts
Thank you for that.

there is the debugging, in french, sorry :
the green italic is from me

Démarrage du script (launch)
Script chargé et prêt à l'emploi (loaded and ready to go)
(function call?)Appel de la fonction : OnEvent_Initialize
Erreur : Argument ou appel de procédure incorrect (code : -2146828283)
       Fichier : yahoo2live.js. Ligne : 14.
La fonction OnEvent_Initialize a retourné une erreur. Code : -2147352567
07-05-2012 12:24 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
36 / Male / Flag
Joined: Dec 2002
Status: Away
RE: sending a message to all my contacts
Javascript code:
var oContacts = [];
var Message = 'This is where your message would go.';
 
function OnEvent_Initialize() {
    OnEvent_SigninReady();
}
 
function OnEvent_SigninReady() {
    if (Messenger.MyStatus < STATUS_INVISIBLE) return false;
   
    for (var eContact = new Enumerator(Messenger.MyContacts); !eContact.atEnd(); eContact.moveNext())
        oContacts.push(eContact.item()); // I was missing a semi colon       
    MsgPlus.AddTimer('_Timer', 60000); // Run every minute | Apparently the Timer ID string cannot be empty}
 
function OnEvent_Timer(sTimerId) { // We're going to accept a parameter now    var bSent = true;
    var oChatWnd;
    while (bSent === true && oContacts.length > 0) {
        oChatWnd = Messenger.OpenChat(oContacts[0]);
        if (oChatWnd.EditChangeAllowed === true) // Can we send a message?
            bSent = oChatWnd.SendMessage(Message); // Store the result in a variable incase we've hit the flood protection
           
            Interop.Call('user32', 'SendMessageW', oChatWnd.Handle, 0x10 /* WM_CLOSE */, 0) // Close the window regardless
           
            if (bSent === true) // Was the message sent correctly?
                oContacts.shift(); // Drop the first element of the array
            else
                if (oContacts.length > 0)
                    MsgPlus.AddTimer(sTimerId, 60000); // Run every minute | And we are going to use the parameter to re-add the timer  
    }
}


This post was edited on 07-05-2012 at 03:20 PM by matty.
07-05-2012 12:42 PM
Profile E-Mail PM Find Quote Report
gregrj
Junior Member
**


Posts: 20
Joined: Feb 2011
O.P. RE: sending a message to all my contacts
WONDERFUL, I test that right now...

edit :

code:
Erreur : '}' attendu (code : -2146827279)
       Fichier : yahoo2live.js. Ligne : 29.

If I may ask even MORE !! is there a way to add anything on the nickname of a person who has received the message ?

yes I know, I'm a spoiled kid...

This post was edited on 07-05-2012 at 01:06 PM by gregrj.
07-05-2012 01:03 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
36 / Male / Flag
Joined: Dec 2002
Status: Away
RE: sending a message to all my contacts
For some reason the second last curly bracket ended up on the same line as the comment above it.

I have removed all comments so the board doesn't screw anything up in the code.

Javascript code:
var oContacts = [];
var Message = 'This is where your message would go.';
 
function OnEvent_Initialize() {
    OnEvent_SigninReady();
}
 
function OnEvent_SigninReady() {
    if (Messenger.MyStatus < STATUS_INVISIBLE) return false;
   
    for (var eContact = new Enumerator(Messenger.MyContacts); !eContact.atEnd(); eContact.moveNext())
        oContacts.push(eContact.item());
    MsgPlus.AddTimer('_Timer', 60000);
 
function OnEvent_Timer(sTimerId) {
    var bSent = true;
    var oChatWnd;
    while (bSent === true && oContacts.length > 0) {
        oChatWnd = Messenger.OpenChat(oContacts[0]);
        if (oChatWnd.EditChangeAllowed === true)
            bSent = oChatWnd.SendMessage(Message);
           
            Interop.Call('user32', 'SendMessageW', oChatWnd.Handle, 0x10 /* WM_CLOSE */, 0)
           
            if (bSent === true)
                MsgPlus.LogEvent('Notification:', oContacts[0].Name+' has been notified of email change.', EVICON_PLUS);
                oContacts.shift();
            else
                if (oContacts.length > 0)
                    MsgPlus.AddTimer(sTimerId, 60000);
    }
}


I also added that when a contact is successfully sent a message an entry will be added to the Event Viewer.
07-05-2012 03:26 PM
Profile E-Mail PM Find Quote Report
gregrj
Junior Member
**


Posts: 20
Joined: Feb 2011
O.P. RE: sending a message to all my contacts
NICE :)
testing....
07-05-2012 03:30 PM
Profile E-Mail PM Find Quote Report
gregrj
Junior Member
**


Posts: 20
Joined: Feb 2011
O.P. RE: sending a message to all my contacts
weird :

Erreur : Erreur de syntaxe (code : -2146827286)
       Fichier : yahoo2Live.js. Ligne : 28.

syntax error for   "else" ???
07-05-2012 03:34 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


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