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).