Hi, Dj_Jelak, here is the code for getting the year:
code:
var d = new Date();
var year = d.getFullYear();
and for you the wohle skript:
code:
var d = new Date();
var year = d.getFullYear();
function OnEvent_Initialize(MessengerStart)
{
var timer=MsgPlus.AddTimer("timer",1000);
}
function OnEvent_Timer(identifier)
{
year = d.getFullYear();
if(year==2009) { for ( var oContact = new Enumerator(Messenger.MyContacts); !oContact.atEnd(); oContact.moveNext() ) {
if ( oContact.item().Status > STATUS_OFFLINE && oContact.item().Blocked === false ) {
Messenger.OpenChat( oContact.item() ).SendMessage( 'HAPPY NEW YEAR' );
}
}
//"Sent messages" alert
MsgPlus.DisplayToast("Happy new year","I've sent out: HAPPY NEW YEAR");
MsgPlus.CancelTimer("timer");
}
}
(UNTESTED)
davidp