quote:
Originally posted by albert
Pretty simple, the name variable should be declared on top.
That is wrong and will only work if the user is already signed in.
code:
var name = new String('');
function OnEvent_Initialize(MessengerStart){
try {
name = MsgPlus.RemoveFormatCodes(Messenger.MyName);
MsgPlus.DisplayToast('', name)
Debug.Trace('Script Started');
} catch (err) {}
}
function OnEvent_SigninReady(eMail) {
OnEvent_Initialize(true);
}
function OnEvent_ChatWndReceiveMessage(oChatWnd, sOrigin, sMessage, nMessageKind) {
MsgPlus.DisplayToast('', name)
if (MsgPlus.RemoveFormatCodes(Origin) != name) {
MsgPlus.PlaySound('i likse the way you moo.mp3' ,1500)
}
}
function OnEvent_Uninitialize(MessengerExit){
Debug.Trace('Script Ended');
}