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:
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: global variable not working
quote:
Originally posted by scutterman
Ol, Matty's code seems good but  i did notice that the:

if (MsgPlus.RemoveFormatCodes(Origin) != name) {

inside the ChatWndReceiveMessage function should replace "Origin" with "sOrigin" since that's what it is declared as in the function, is that right?

Thanks again for all of the help
~~Scutterman~~

That is true but there are problems with your code if you end up using some features of StuffPlug or something like that however.... I suggest using the following code instead....
code:
var aSent = new Array();

function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    aSent[ChatWnd.Handle] = Message;
}

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
    if (aSent[ChatWnd.Handle] === Message) {
        delete aSent[ChatWnd.Handle];
    } else {
        MsgPlus.PlaySound("i likse the way you moo.mp3",1500) //this sound will be replaced with "type" when i have converted it to mp3
    }
}

Please note that this isn't my code, it is CookieRevised's code and any thanks should go to him.  It is a more failsafe way of going about what you are trying and I HIGHLY recommend that you use it instead.

I also would like to point everyone to the code at the bottom of CookieRevised's reply to [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin for any issue involving triggering events only when a contact sends a message.
[Image: markee.png]
07-24-2007 01:54 PM
Profile 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