What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » RegWrite Causing Errors?

RegWrite Causing Errors?
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: RegWrite Causing Errors?
quote:
Originally posted by Mattike
code:
if(MessengerStart && Messenger.MyStatus > 1)

As phalanxii pointed out, this is wrong and can never become true since if MessengerStart is true, Messenger.MyStatus will always be 0.

However...
quote:
Originally posted by phalanxii
but if I'm not mistaken, shouldn't it be:
code:
function OnEvent_Initialize(MessengerStart) {
   if(!MessengerStart && Messenger.MyStatus > 1) {
       OnEvent_SigninReady(Messenger.MyEmail); //Call the event like a normal function
   }
}
function OnEvent_SigninReady(Email) {
   //Original code for OnEvent_Initialize goes here
}
That way, OnEvent_SigninReady executes when a) the script is enabled when Messenger is signed in and b) when you sign in to Messenger. Also, if you don't need any details from contacts, you can use OnEvent_Signin instead, as this will give the same result, but a lot earlier.

That's not correct either though. The stuff in SigninReady will not be executed when Messenger is started the first time...

And if you check on Messenger.MyStatus you do not need to check on MessengerStart too.

Because if Messenger is started the first time, your status (and email) can not be something as you still need to sign in.

If the script is restarted (and thus MessengerStart is false) the important thing is again your status. If that is 0 (not signed in), Messenger.MyEmail will not be defined. If you are signed in, Messenger.MyEmail will be defined.

So, the proper code you want is:
code:
function OnEvent_Initialize(MessengerStart) {
   if(Messenger.MyStatus > 0) {
       OnEvent_SigninReady(Messenger.MyEmail);
   }
}
function OnEvent_SigninReady(Email) {
   //Original code for OnEvent_Initialize goes here
}
1) you start messenger thus script is started for the first time:
  OnEvent_Initialize is called
    MessengerStart is true
    Messenger.MyStatus is 0
    Messenger.MyEmail is undefined

2) you restart the script:
  OnEvent_Initialize is called
    MessengerStart is false
    Messenger.MyStatus is 0
    Messenger.MyEmail is undefined

3) you sign in:
  OnEvent_Signin(Ready) is called
    Messenger.MyStatus is >0
    Messenger.MyEmail is defined

4) you restart the script:
  OnEvent_Initialize is called
    MessengerStart is false
    Messenger.MyStatus is >0
    Messenger.MyEmail is defined

5) you sign out and then you restart the script
  see 2

This post was edited on 09-15-2006 at 10:28 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-15-2006 10:16 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
RegWrite Causing Errors? - by Spunky on 09-14-2006 at 04:28 PM
RE: RegWrite Causing Errors? - by Matti on 09-14-2006 at 04:39 PM
RE: RegWrite Causing Errors? - by R4000 on 09-14-2006 at 05:04 PM
RE: RegWrite Causing Errors? - by Spunky on 09-14-2006 at 05:12 PM
RE: RegWrite Causing Errors? - by phalanxii on 09-15-2006 at 12:02 AM
RE: RE: RegWrite Causing Errors? - by CookieRevised on 09-15-2006 at 10:16 AM
RE: RegWrite Causing Errors? - by phalanxii on 09-15-2006 at 01:14 PM
RE: RE: RegWrite Causing Errors? - by CookieRevised on 09-15-2006 at 10:03 PM
RE: RegWrite Causing Errors? - by Matti on 09-15-2006 at 01:17 PM
RE: RegWrite Causing Errors? - by Spunky on 09-15-2006 at 10:18 PM
RE: RegWrite Causing Errors? - by CookieRevised on 09-15-2006 at 10:20 PM
RE: RegWrite Causing Errors? - by Spunky on 09-15-2006 at 10:22 PM
RE: RE: RE: RegWrite Causing Errors? - by phalanxii on 09-15-2006 at 10:25 PM
RE: RE: RE: RE: RegWrite Causing Errors? - by CookieRevised on 09-15-2006 at 10:29 PM
RE: RegWrite Causing Errors? - by Spunky on 09-15-2006 at 10:28 PM
RE: RegWrite Causing Errors? - by phalanxii on 09-15-2006 at 10:33 PM
RE: RegWrite Causing Errors? - by Spunky on 09-15-2006 at 10:34 PM
RE: RegWrite Causing Errors? - by CookieRevised on 09-15-2006 at 10:37 PM
RE: RegWrite Causing Errors? - by Spunky on 09-15-2006 at 10:40 PM
RE: RegWrite Causing Errors? - by CookieRevised on 09-15-2006 at 10:43 PM
RE: RegWrite Causing Errors? - by Spunky on 09-15-2006 at 10:52 PM
RE: RegWrite Causing Errors? - by CookieRevised on 09-15-2006 at 10:57 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