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

status script
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: status script
You're not supposed to fill something in in that string variable!
It does not define what status is being set after all the chat windows are closed.
it actually doesn't matter what you fill in there, any random string will do, as long as you keep it the same in all the used strings in the entire script.

------

This said, there is a bug in the script.
  if(Messenger.CurrentChats.Count === 0){
should be
  if(Messenger.CurrentChats.Count === 1){
Reason being that OnEvent_ChatWndDestroyed() is executed _before_ the chat window is destroyed (which is logical, considering it needs to pass the ChatWnd object for the window which is going to be destroyed).

------

and
  if(Messenger.CurrentChats.Count > 0)
isn't needed at all, the number of chats will always be >0 in the OnEvent_ChatWndCreated() event because this event is fired _after_ the chat is created (again logical, because of the same reason above). But this isn't a bug though, it's just redundant code.

------

Thus:
js code:
var old_status = "";

function OnEvent_ChatWndCreated() {
    if (old_status === "") old_status = Messenger.MyStatus;
    Messenger.MyStatus = STATUS_BUSY;
}

function OnEvent_ChatWndDestroyed() {
  if (Messenger.CurrentChats.Count === 1) {
    Messenger.MyStatus = old_status;
    old_status = "";
  }
}

This post was edited on 10-21-2010 at 07:47 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
10-21-2010 07:22 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
status script - by puortant on 10-15-2010 at 02:31 AM
RE: status script - by Spunky on 10-15-2010 at 09:15 AM
RE: status script - by matty on 10-15-2010 at 11:16 AM
RE: status script - by foaly on 10-15-2010 at 11:22 AM
RE: status script - by matty on 10-15-2010 at 11:23 AM
RE: status script - by Spunky on 10-15-2010 at 11:25 AM
RE: status script - by CookieRevised on 10-15-2010 at 11:43 AM
RE: status script - by puortant on 10-21-2010 at 02:25 AM
RE: status script - by CookieRevised on 10-21-2010 at 04:58 AM
RE: status script - by puortant on 10-21-2010 at 06:23 AM
RE: status script - by CookieRevised on 10-21-2010 at 07:22 AM
RE: RE: status script - by puortant on 10-21-2010 at 12:16 PM
RE: status script - by Spunky on 10-21-2010 at 08:56 AM
RE: status script - by puortant on 10-21-2010 at 12:32 PM
RE: status script - by CookieRevised on 10-21-2010 at 01:46 PM
RE: status script - by puortant on 10-21-2010 at 10:14 PM
RE: status script - by Spunky on 10-22-2010 at 07:46 AM
RE: status script - by puortant on 10-22-2010 at 12:23 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