Shoutbox

sending a message to all my 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: sending a message to all my contacts (/showthread.php?tid=99439)

sending a message to all my contacts by gregrj on 07-04-2012 at 01:57 PM

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


RE: sending a message to all my contacts by matty on 07-04-2012 at 02:19 PM

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
    }
}


RE: sending a message to all my contacts by gregrj on 07-04-2012 at 05:07 PM

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)
RE: sending a message to all my contacts by matty on 07-04-2012 at 05:13 PM

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.
RE: sending a message to all my contacts by gregrj on 07-05-2012 at 12:24 PM

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


RE: sending a message to all my contacts by matty on 07-05-2012 at 12:42 PM

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  
    }
}


RE: sending a message to all my contacts by gregrj on 07-05-2012 at 01:03 PM

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...
RE: sending a message to all my contacts by matty on 07-05-2012 at 03:26 PM

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.
RE: sending a message to all my contacts by gregrj on 07-05-2012 at 03:30 PM

NICE :)
testing....


RE: sending a message to all my contacts by gregrj on 07-05-2012 at 03:34 PM

weird :

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

syntax error for   "else" ???


RE: sending a message to all my contacts by matty on 07-05-2012 at 03:35 PM

Yeah I just noticed as I was about to close it.

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);
    }
}


RE: sending a message to all my contacts by gregrj on 07-05-2012 at 10:55 PM

strange but I got this error :

Erreur : '}' attendu (code : -2146827279)
       Fichier : yahoo2live.js. Ligne : 33.
Démarrage du script

then I add a } to the last line...
error gone, but may be I messed up..
Checking right now.

Anyway Thank You :)


RE: sending a message to all my contacts by gregrj on 07-06-2012 at 11:45 AM

It might work... My contacts are pretty slow...:/
but I don't see any notifications in event viewer
don't know if this part works.


RE: sending a message to all my contacts by Mnjul on 07-06-2012 at 01:50 PM

The missing curly bracelet should be added after the first occurrence of "MsgPlus.AddTimer('_Timer', 60000);", not the last line. See if that fixes the problem.


RE: sending a message to all my contacts by gregrj on 07-06-2012 at 10:11 PM

like this ?

Javascript code:
var oContacts = [];
var Message = 'Salut Salut !, je suis en cours de migration sur gregreg94@live.fr , tu es ok pour rajouter cette adresse ? Si tu le fais, fais le moi savoir avec un petit mot stp :) Bises';
 
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);
    }
}


again thank you for such investissement.
RE: sending a message to all my contacts by gregrj on 07-09-2012 at 02:55 PM

OKaaayy...
Agian, I'm really GRATEFUL for your time and efforts..
but actually, it could be a disaster... ^^

I thik 99,99 of my contacts blocked me because, they all receive multiple message , actually one every 7 minutes for may be all the weekend


*-)



RE: sending a message to all my contacts by matty on 07-10-2012 at 12:24 PM

quote:
Originally posted by gregrj
OKaaayy...
Agian, I'm really GRATEFUL for your time and efforts..
but actually, it could be a disaster... ^^

I thik 99,99 of my contacts blocked me because, they all receive multiple message , actually one every 7 minutes for may be all the weekend


*-)
I don't see how that is possible unless you were signed out and back in a bunch of times. The idea was that you run and then disable the script.
RE: sending a message to all my contacts by segosa on 07-14-2012 at 09:26 AM

I'm surprised there's anyone left who still wrongly uses Hungarian notation.