What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » global variable not working

global variable not working
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: global variable not working
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');
}


This post was edited on 07-24-2007 at 02:29 AM by matty.
07-24-2007 02:10 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
global variable not working - by scutterman on 07-23-2007 at 09:30 PM
RE: global variable not working - by roflmao456 on 07-23-2007 at 10:33 PM
RE: global variable not working - by albert on 07-23-2007 at 10:56 PM
RE: global variable not working - by scutterman on 07-23-2007 at 11:07 PM
RE: global variable not working - by Spunky on 07-23-2007 at 11:39 PM
RE: global variable not working - by matty on 07-24-2007 at 02:10 AM
RE: global variable not working - by albert on 07-24-2007 at 02:21 AM
RE: global variable not working - by matty on 07-24-2007 at 02:28 AM
RE: global variable not working - by scutterman on 07-24-2007 at 09:07 AM
RE: global variable not working - by matty on 07-24-2007 at 01:16 PM
RE: global variable not working - by markee on 07-24-2007 at 01:54 PM
RE: global variable not working - by scutterman on 07-24-2007 at 03:17 PM
RE: global variable not working - by matty on 07-24-2007 at 03:55 PM


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