quote:
Originally posted by roflmao456
maybe if you try local variables ?
I don't see how this would solve the issue. =P
quote:
Originally posted by roflmao456
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.
Pretty simple, the name variable should be declared on top.
Eg :
code:
name = Messenger.MyName;
function OnEvent_Initialize(MessengerStart)
{
Debug.Trace("Script Started");
}
function OnEvent_SigninReady(Email) // this should assign the name to the variable
{
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
}
}