code:
var _enabled = new Boolean(false);
var oprindeligPB;
function _update_mypersonalmessage(_conversations) {
var _online = 0;
var _offline = 0;
var _total = 0;
for(var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext()) {
if(e.item().Status == 1) { _offline++; }
else { _online++; }
}
var _total = (_online + _offline);
Messenger.MyPersonalMessage = "Online: " + _online + " | Offline: " + _offline + " | I alt: " + _total + " | Åbne vinduer: " + _conversations;
}
function OnEvent_Initialize(bMessengerStart){
try{
oprindeligPB = Messenger.MyPersonalMessage;
}catch (e){}
}
function OnEvent_SignInReady(sEmail) {
if (oprindeligPB != Messenger.MyPersonalMessage){ oprindeligPB = Messenger.MyPersonalMessage; }
if (_enabled == true) { _update_mypersonalmessage(Messenger.Chats.Count); }
}
function OnEvent_Uninitialize(bMessengerExit) {
Messenger.MyPersonalMessage = oprindeligPB;
}
function OnEvent_ContactSignin(){
if (_enabled == true) { _update_mypersonalmessage(Messenger.Chats.Count); }
}
function OnEvent_ContactSignout() {
if (_enabled == true) { _update_mypersonalmessage(Messenger.Chats.Count); }
}
function OnEvent_ChatWndCreated(){
if (_enabled == true) { _update_mypersonalmessage(Messenger.Chats.Count); }
}
function OnEvent_ChatWndDestroyed() {
if (_enabled == true) { _update_mypersonalmessage(Messenger.Chats.Count-1); }
}
function OnGetScriptMenu(Location) {
ScriptMenu = "<ScriptMenu>";
ScriptMenu += "<MenuEntry Id=\"tilfra\">";
if (Status == "fra") { ScriptMenu += "Slå til"; }
else { ScriptMenu += "Slå fra"; }
ScriptMenu += "</MenuEntry>";
ScriptMenu += "</ScriptMenu>";
return ScriptMenu;
}
function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd) {
switch(MenuItemId) {
case "tilfra":
if (_enabled == false) {
_enabled = true;
MsgPlus.DisplayToast("Kontakt information", "Kontakt information er slået til.");
_update_mypersonalmessage(Messenger.Chats.Count);
} else {
_enabled = false;
MsgPlus.DisplayToast("Kontakt information", "Kontakt information er slået fra.");
Messenger.MyPersonalMessage = oprindeligPB;
}
break;
}
}
Would look something like this.