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:
scutterman
Junior Member
**

Avatar
-- Scutterman avatar from Runescape

Posts: 21
– / Male / Flag
Joined: Jul 2007
O.P. global variable not working
I cant touch type so if someone sends me a msg while I am sending one to them I somethimes don't see it until I have sent my msg.

I am trying to create a script to play a sound whenever another person in the coversation sends a message

The code is:

var name; // used to store the name of the user

function OnEvent_Initialize(MessengerStart)
{

    Debug.Trace("Script Started");

}


function OnEvent_SigninReady(Email) // this should assign the name to the variable
{
    name = Messenger.MyName;
    name = MsgPlus.RemoveFormatCodes(name);
    MsgPlus.DisplayToast("",name) // i used this to confirm that this stage was working. It is
}



function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind) // this should play the sound
{                                                                  //if origin is not the same as name

MsgPlus.DisplayToast("",name) // this is used to check that the name is still stored. It is just blank.

Origin = MsgPlus.RemoveFormatCodes(Origin);

    if (Origin != name)
    {
    MsgPlus.PlaySound("i likse the way you moo.mp3",1500) //this sound will be replaced with "type" when i have converted it to mp3
    }
}


function OnEvent_Uninitialize(MessengerExit)
{

    Debug.Trace("Script Ended");

}


The problem is that "name" seems to loose its value when the SigninReady function ends, which it shouldn't do because i've declared it as a global variable.

I'm pretty new to jscript and mpl scripting so any help is appreciated.

Thanks
~~Scutterman~~

Of course the world doesn't make sense
Its only purpose is to be somewhere that
humans can stand around in complaining
that the world doesn't make sense


07-23-2007 09:30 PM
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