PS: this is a simple script which simply adds the tags (!PS_E), (!PS_ES), (!PS_EM) and (!PS_EH) back so they can be used in an auto-response message (and chat text).
js code:
var DateTimeSet = new Date();
var bPersonalStatus = false;
function OnEvent_EnterPersonalizedStatus(eNewStatus, sNameTag, sPersonalMessage, sAutoMessage) {
bPersonalStatus = true;
DateTimeSet = new Date();
}
function OnEvent_LeavePersonalizedStatus() {
bPersonalStatus = false;
}
function OnEvent_ChatWndSendMessage(oChatWnd, sMessage) {
// Let's only look for the tag when we are in a personalised status
if (bPersonalStatus) {
var secs = Math.floor((new Date().getTime() - DateTimeSet.getTime()) / 1000);
var hours = Math.floor(secs / 3600);
secs -= hours * 3600;
var mins = Math.floor(secs / 60);
secs -= mins * 60;
sMessage = sMessage.replace(/\(\!PS_E\)/g,((hours>9)?hours:'0'+hours) + ':' + ((mins>9)?mins:'0'+mins) + ':' + ((secs>9)?secs:'0'+secs));
sMessage = sMessage.replace(/\(\!PS_ES\)/g,secs);
sMessage = sMessage.replace(/\(\!PS_EM\)/g,mins);
sMessage = sMessage.replace(/\(\!PS_EH\)/g,hours);
}
return sMessage
}
PS: a more elaborate script is attached. It also adds (!S_E), (!S_ES) , (!S_EM) , (!S_EH) tags which will show the elapsed time since the last status change. Thus, independant of the personalised status. Therefor they also work when you are not in a personalised status.