i didn't quite get what you posted to work matty, but i took some time to properly read the documentation and changed the method and since i only wanted it for when im idle changed it accordingly
Even got the psm stored and restored working ^^, not bad for a first try
code:
var LOCALE_USER_DEFAULT = 0x400;
var TIME_NOSECONDS = 0x2;
function OnEvent_Uninitialize(MessengerExit)
{
Messenger.MyPersonalMessage = oPSM;
}
function OnEvent_MyStatusChange(nStatus) {
if (nStatus == 6) {
var SYSTEMTIME = Interop.Allocate(16);
var sTime = Interop.Allocate(512);
var sDate = Interop.Allocate(512);
Interop.Call('kernel32', 'GetSystemTime', SYSTEMTIME);
Interop.Call('kernel32', 'GetTimeFormatW', LOCALE_USER_DEFAULT, TIME_NOSECONDS, SYSTEMTIME, 0, sTime, sTime.Size);
Interop.Call('kernel32', 'GetDateFormatW', LOCALE_USER_DEFAULT, 0, SYSTEMTIME, 0, sDate, sDate.Size);
Messenger.MyPersonalMessage = 'Idle since '+sDate.ReadString(0) +' '+sTime.ReadString(0)+' (GMT0)' ;
isIdle = true;
oPSM = Messenger.MyPersonalMessage;
}
else if( isIdle == true )
{
isIdle = false;
Messenger.MyPersonalMessage = oPSM;
}
}