Ummm, WTF? |
Author: |
Message: |
Geodesic_Dragon
New Member
I <3 teh Combine!
Posts: 6 Reputation: 1
37 / / –
Joined: Apr 2006
|
O.P. 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 |
|
|
alexp2_ad
Scripting Contest Winner
Who love the chocolate?
Posts: 691 Reputation: 26
37 / / –
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 |
|
|
Geodesic_Dragon
New Member
I <3 teh Combine!
Posts: 6 Reputation: 1
37 / / –
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 |
|
|
NanaFreak
Scripting Contest Winner
Posts: 1476 Reputation: 53
32 / /
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 |
|
|
alexp2_ad
Scripting Contest Winner
Who love the chocolate?
Posts: 691 Reputation: 26
37 / / –
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 |
|
|
NanaFreak
Scripting Contest Winner
Posts: 1476 Reputation: 53
32 / /
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 |
|
|
alexp2_ad
Scripting Contest Winner
Who love the chocolate?
Posts: 691 Reputation: 26
37 / / –
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.
|
|
09-07-2006 09:12 AM |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
Joined: Jan 2006
|
RE: Ummm, WTF?
This post was edited on 09-07-2006 at 09:15 AM by markee.
|
|
09-07-2006 09:13 AM |
|
|
alexp2_ad
Scripting Contest Winner
Who love the chocolate?
Posts: 691 Reputation: 26
37 / / –
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 |
|
|
CookieRevised
Elite Member
Posts: 15517 Reputation: 173
– / /
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 |
|
|
|