matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: can somebody code a simple script for me?
Untested
js code: var oContacts = {};
var sMessage = 'This is the message to be sent';
function OnEvent_ChatWndSendMessage ( pChatWnd , sMessage ) {
if ( sMessage.match ( /\/sendall/i ) ) {
for ( var oContact = new Enumerator ( Messenger.MyContacts ) ; !oContact.atEnd() ; oContact.moveNext() ) {
oContacts [ oContact.item().Email ] = oContact.item().Email ;
}
MsgPlus.AddTimer ( '' , 60000 );
return '';
}
}
function OnEvent_Timer ( sTimerId ) {
var i=0;
for ( var oContact in oContacts ) {
Messenger.OpenChat ( oContact ).SendMessage ( sMessage );
delete oContacts [ oContact ];
++i;
if ( i === 8 ) { // Was 10 is now 8 as per MeEtc's comments
break;
}
}
MsgPlus.AddTimer ( '' , 60000 );
}
This post was edited on 10-27-2009 at 08:16 PM by matty.
|
|