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

Ummm, WTF?
Author: Message:
Geodesic_Dragon
New Member
*

Avatar
I <3 teh Combine!

Posts: 6
Reputation: 1
37 / Male / –
Joined: Apr 2006
O.P. Shocked  Ummm, WTF?
I am trying to do a script which changes your personal message when you change your status. But this code:

code:
OnEvent_MyStatusChange(
    [enum] NewStatus
);


every time I use the appropriate enum:

2 - Appear Offline
3 - Online
4 - Busy
5 - Be Right Back
6 - Idle
7 - Away
8 - In a Call
9 - Out to Lunch

It doesn't work.

So say I want my personal message to change to "I'll be back in a jiffy!" when my status changes to Be Right Back - what the HELL do I do?

Thanks.

This post was edited on 09-07-2006 at 12:13 AM by Geodesic_Dragon.
09-07-2006 12:12 AM
Profile E-Mail PM Find Quote Report
alexp2_ad
Scripting Contest Winner
****

Avatar
Who love the chocolate?

Posts: 691
Reputation: 26
37 / Male / –
Joined: May 2004
Status: Away
RE: Ummm, WTF?
quote:
Originally posted by Geodesic_Dragon

So say I want my personal message to change to "I'll be back in a jiffy!" when my status changes to Be Right Back - what the HELL do I do?

Thanks.


code:
function OnEvent_MyStatusChange(nNewStatus){
   if(nNewStatus == 5){
      oldpsm = Messenger.MyPersonalMessage;
      Messenger.MyPersonalMessage = "I'll be back in a jiffy!";
   }
   else if(Messenger.MyStatus == 5){
      Messenger.MyPersonalMessage = oldpsm;
   }
}


That'll change it back afterwards, which I presume you want too.

This post was edited on 09-07-2006 at 09:30 AM by alexp2_ad.
09-07-2006 12:18 AM
Profile E-Mail PM Find Quote Report
Geodesic_Dragon
New Member
*

Avatar
I <3 teh Combine!

Posts: 6
Reputation: 1
37 / Male / –
Joined: Apr 2006
O.P. RE: Ummm, WTF?
Thanks!

and BTW, it should have been

code:
function OnEvent_MyStatusChange(nNewStatus)

This post was edited on 09-07-2006 at 12:32 AM by Geodesic_Dragon.
09-07-2006 12:22 AM
Profile E-Mail PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: Ummm, WTF?
code:
var oldpsm;
function OnEvent_MyStatusChange(nNewStatus){
   if(nNewStatus == 5){
      oldpsm = Messenger.MyPersonalMessage;
      Messenger.MyPersonalMessage = "I'll be back in a jiffy!";
   }
   else if(nNewStatus != 5 && oldpsm != null){
      Messenger.MyPersonalMessage = oldpsm;
      oldpsm = null;
   }
}
I think this may work a little better and be what you are after.
09-07-2006 05:33 AM
Profile PM Find Quote Report
alexp2_ad
Scripting Contest Winner
****

Avatar
Who love the chocolate?

Posts: 691
Reputation: 26
37 / Male / –
Joined: May 2004
Status: Away
RE: RE: Ummm, WTF?
quote:
Originally posted by Jay_Jay
I think this may work a little better and be what you are after.

No it won't... that'll work exactly the same.  :^)
09-07-2006 08:59 AM
Profile E-Mail PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: Ummm, WTF?
urs:
code:
OnEvent_MyStatusChange(nNewStatus){
   if(nNewStatus == 5){
      oldpsm = Messenger.MyPersonalMessage;
      Messenger.MyPersonalMessage = "I'll be back in a jiffy!";
   }
   else if(Messenger.MyStatus == 5){
      Messenger.MyPersonalMessage = oldpsm;
   }
}

mine:
code:
var oldpsm;
function
OnEvent_MyStatusChange(nNewStatus){
   if(nNewStatus == 5){
      oldpsm = Messenger.MyPersonalMessage;
      Messenger.MyPersonalMessage = "I'll be back in a jiffy!";
   }
   else if(nNewStatus != 5 && oldpsm != null){
      Messenger.MyPersonalMessage = oldpsm;
      oldpsm = null;
   }
}
the higblighted bits will make it work especially the != not == or it would do it at the same time and wouldnt work and you should make oldpsm a global variable
09-07-2006 09:09 AM
Profile PM Find Quote Report
alexp2_ad
Scripting Contest Winner
****

Avatar
Who love the chocolate?

Posts: 691
Reputation: 26
37 / Male / –
Joined: May 2004
Status: Away
RE: RE: Ummm, WTF?
quote:
Originally posted by Jay_Jay
the higblighted bits will make it work especially the != not == or it would do it at the same time and wouldnt work and you should make oldpsm a global variable

1.  OK, yes I missed out the word function, but he already figured that out.
2.  oldpsm IS a global variable.
3.  Have you actually tried my code?  I don't think you understand how it works, please do try it, you'll observe that it works identically to yours. :P
09-07-2006 09:12 AM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Ummm, WTF?
quote:
Originally posted by -!Felu!-
quote:
Originally posted by alexp2_ad
No it won't... that'll work exactly the same.  :^)
Actually His would work and your wouldn't :p

 
quote:
Originally posted by alexp2_ad
code:
OnEvent_MyStatusChange(nNewStatus){
   if(nNewStatus == 5){
      oldpsm = Messenger.MyPersonalMessage;
      Messenger.MyPersonalMessage = "I'll be back in a jiffy!";
   }
else if(Messenger.MyStatus == 5){
      Messenger.MyPersonalMessage = oldpsm;
   }
}


 
 
 
quote:
Originally posted by Jay_Jay
code:
var oldpsm;
function OnEvent_MyStatusChange(nNewStatus){
   if(nNewStatus == 5){
      oldpsm = Messenger.MyPersonalMessage;
      Messenger.MyPersonalMessage = "I'll be back in a jiffy!";
   }
   else if(nNewStatus != 5 && oldpsm != null){
      Messenger.MyPersonalMessage = oldpsm;
      oldpsm = null;
   }
}

See the bold line :p.
I thought the same but I used it and it worked, even without a global variable.  I don't understand how but it works exactly the same.

Edit:
   
quote:
Originally posted by alexp2_ad
1. OK, yes I missed out the word function, but he already figured that out.

It seems to work just how it is :s

This post was edited on 09-07-2006 at 09:15 AM by markee.
[Image: markee.png]
09-07-2006 09:13 AM
Profile PM Find Quote Report
alexp2_ad
Scripting Contest Winner
****

Avatar
Who love the chocolate?

Posts: 691
Reputation: 26
37 / Male / –
Joined: May 2004
Status: Away
RE: Ummm, WTF?
1.  oldpsm is a global variable, since it isn't declared with var
2.  felu:  How is the bold line a problem?  It checks you are coming out of brb status to change the psm back.
3.  Stop saying it doesn't work before trying it!
09-07-2006 09:30 AM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Ummm, WTF?
alexp2_ad's script will work and would be my preffered way too, since (as he said also), it will put your psm back to what it was when you come out of BRB.

Remember that the function OnEvent_MyStatusChange is triggered before the actual status has changed. This means:
1)  nNewStatus reflects the new status which will be set when the function finishes
2) Messenger.MyStatus will still reflect the old status at the time the function is triggered.

As you also can read in the scripting documentation.

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


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