What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin

[Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin
quote:
Originally posted by markee
I believe you still have to specify how the variable is stored in the registry
You should, but you don't need to. And that is exactly what many new scripters forget to do. When you don't do it and depending on how you've set up the variable or what method you use to write to the registry, it can revert back to the default REG_SZ, a string, not REG_DWORD, a number, for example.

And that is exactly why I didn't use an identity (===) operator, but a equality (==) operator, because you don't know what _other_ scripts have done with that value...

Bottom line:
When reading something from the registry: always use a equality operator, or use a similar function to handle unexpected types.
When writing to the registry: always define the correct type of the value, and don't trust upon 'default' settings.


quote:
Originally posted by Deco
Cookie,
that check you sent using message compare will fail with a simple "hi".
how?

quote:
Originally posted by Deco
Maybe you could use all three types sent in so far. Use deAd's boolean
His code, unfortunatly, will fail in more situations and should not be used, even not together with other methods (discussed before).

Not only will it fail when a message is recieved between you sending a message and Messenger putting your message in the chat window (which is rare, but it CAN happen; the busier you are chatting with different people at the same time, the more chance you have this will happen).

But the chance of failing will be extremely bigger when you have more than one chat going on (which is far from rare), since he used just 1 global variable for checking every possible chat window.

If you want to use a simply, easy method, use the second snipped I posted. As you will see it is basically the exact same thing as what deAd did, but it handles individual chats properly and thus will work with multipe chats. Though, it still would fail if a message is recieved between you sending a message and Messenger putting it in the chat.

(note: the snippet is just that: a snippet outlining the method. You do need to add some more things like removing the array items when a chat is closed, etc to implement it properly).

This post was edited on 12-16-2007 at 03:09 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-16-2007 01:18 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 01-22-2007 at 03:05 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 03:26 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 03:36 AM
RE: RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 03:42 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 01-22-2007 at 03:45 AM
RE: RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 04:11 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 04:14 AM
RE: RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 04:17 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 04:22 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 01-22-2007 at 04:48 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 05:00 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by bigbob85 on 12-14-2007 at 10:49 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 12-14-2007 at 11:52 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by bigbob85 on 12-15-2007 at 12:16 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 12-15-2007 at 05:16 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by Deco on 12-16-2007 at 11:30 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 12-16-2007 at 01:18 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 12-16-2007 at 01:49 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by bigbob85 on 12-16-2007 at 10:28 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