I'm leaving the idea in "blank" until I find out how to work with it...
thanks for the link!
ok... call me lazy or whatever, but everytime I start programming I get lazy. LOL, I rather other challenges than knocking my head over the monitor while debugging.
Anyway, it is functional, but with some notes:
1- I removed the retrieval of the original PSM, it would require to store in registry or maybe in a .ini file the preferences for each user, I'm not in the mood of improving it right now, but if anyone knows how to make it, feel free, you'll be my guest and I'll be very thankful as many other users who may enjoy the idea.
2- I found a bug, a silly one, no idea how to fix it, but if minutes starts with zero, the time will be shown as this "12:7", instead of "12:07". Any ideas? I hope it won't need to insert the a.m. or p.m. thing, not used around here.
3- the PSM are in brazilian portuguese, feel free to translate to your language, it would help to spread the idea.
4- Optmizing with the switch statement would require to make my lazy programming cell brains to work again... I would have to study Jscript... oh boy... I'll leave this job to you who love programing.
5- Many thanks to Matty! (I don't have enough reputation to give you more...)
code:
var mDate = new Date();
function OnEvent_MyStatusChange(NewStatus) {
if( NewStatus == 3 )
{
Messenger.MyPersonalMessage = ""; //if it's online, no need to change.
}
else if( NewStatus == 6 ) //idle status
{
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Estou ausente desde "+mDate.getHours()+":"+mDate.getMinutes();
}
else if( NewStatus == 4 ) //busy status
{
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Estou ocupado desde "+mDate.getHours()+":"+mDate.getMinutes();
}
else if( NewStatus == 5 ) //brb status
{
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Saí às "+mDate.getHours()+":"+mDate.getMinutes()+" mas volto logo!";
}
else if( NewStatus == 7 ) //away status
{
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Estou ausente desde "+mDate.getHours()+":"+mDate.getMinutes();
}
else if( NewStatus == 8 ) //on a call status
{
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Estou em uma ligação desde "+mDate.getHours()+":"+mDate.getMinutes();
}
else if( NewStatus == 9 ) //out for lunch status
{
Messenger.MyPersonalMessage = "";
Messenger.MyPersonalMessage = "Estou almoçando desde "+mDate.getHours()+":"+mDate.getMinutes();
}
}