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 = "";
}
}