Thats the entire script which I've posted above.
But I've changed some things atm, so here is the actual one:
jscript code:
var fsObj = new ActiveXObject("Scripting.FileSystemObject");
var statuschanged = false;
var Old_Status = 0;
function OnEvent_Initialize(MessengerStart)
{
Old_Status = 0;
isGone = false;
addTimer();
}
function addTimer()
{
MsgPlus.AddTimer("Lock",10000);
}
function OnEvent_Uninitialize(MessengerExit)
{
}
function ReadLineFromFile (file, line)
{
var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 1);
var lineResult = fileObj.ReadAll();
lineResult = lineResult.split('\r\n');
fileObj.Close();
return lineResult[line];
}
function OverwriteFile (file, content) {
var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 2, 0);
fileObj.Write(content);
fileObj.Close();
}
function OnEvent_Timer(timerID)
{
if(timerID == "Lock")
{
addTimer();
if (ReadLineFromFile('lockstatus.ini', 0) == "locked")
{
if (Messenger.MyStatus == STATUS_INVISIBLE)
{
return;
}
else
{
Old_Status = Messenger.MyStatus;
Messenger.MyStatus = STATUS_AWAY;
isGone = true;
}
}
if (ReadLineFromFile('lockstatus.ini', 0) == "unlocked")
{
if (Messenger.MyStatus == STATUS_INVISIBLE)
{
return;
}
else
{
Messenger.MyStatus = Old_Status;
isGone = true;
OverwriteFile('lockstatus.ini', 'off');
}
}
}
}
I've put the "else" lines after the
if (Messenger.MyStatus == STATUS_INVISIBLE) in the code, that way theres no error atm. I've found that there were errors only while I was using WLM with "Invisible" mode, so I hope that problem is fixed for ever, but I'm not sure of it.