What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Whats wrong with my script?

Whats wrong with my script?
Author: Message:
Bluestar
New Member
*


Posts: 10
Reputation: 1
Joined: Apr 2008
O.P. Undecided  Whats wrong with my script?
Hello!

I would like to to write a little script for my PC locker application, that would be able to change the Windows Live Messenger's state to "Away" when the PC is locked by the user. The program should read the lock value (is the pc locked or not atm) from a file, for example an "ini", but a plain text file would be good also (that plain-text is the way I've tried to write that script too).

So could someone help me please? (A)
Thats my (first) script, and as I said before the debugger says "fsObj isn't defined". :chrongue: The status change function is working anyway.




jscript code:
function OnEvent_Initialize(MessengerStart)
{
    addTimer();
    Old_Status = 0;
    isGone = false;
    locked = false;
   
    if (ReadLineFromFile('lockstatus.ini', 1) == "true")
    {
        // status changing code need to be here...
    }
       
    if (locked == false)
    {
        if (Messenger.MyStatus == STATUS_INVISIBLE)
            {
                return;
            }
           
            Old_Status = Messenger.MyStatus;
            Messenger.MyStatus = STATUS_AWAY
            isGone = true;   
    }   
}

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 OnEvent_Timer(timerID){

    if(timerID == "Lock")
    {
       
        if (locked == false)
        {
            if (Messenger.MyStatus == STATUS_INVISIBLE)
            {
                return;
            }
           
            Old_Status = Messenger.MyStatus;
            Messenger.MyStatus = STATUS_AWAY
            isGone = true;   
        }   

    }
   
    addTimer();
}

This post was edited on 11-18-2008 at 02:10 PM by Bluestar.
11-03-2008 07:41 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Whats wrong with my script? - by Bluestar on 11-03-2008 at 07:41 PM
RE: Whats wrong with my script? (debugger says fsObj isn't defined) :( - by ArkaneArkade on 11-03-2008 at 07:46 PM
RE: Whats wrong with my script? (debugger says fsObj isn't defined) :( - by Bluestar on 11-03-2008 at 08:21 PM
RE: Whats wrong with my script? (debugger says fsObj isn't defined) :( - by Bluestar on 11-17-2008 at 04:33 PM
RE: Whats wrong with my script? (debugger says fsObj isn't defined) :( - by foaly on 11-17-2008 at 04:37 PM
RE: Whats wrong with my script? (debugger says fsObj isn't defined) :( - by Bluestar on 11-17-2008 at 04:43 PM
RE: Whats wrong with my script? (debugger says fsObj isn't defined) :( - by Bluestar on 11-18-2008 at 01:51 PM
RE: Whats wrong with my script? - by matty on 11-18-2008 at 02:24 PM
RE: Whats wrong with my script? - by Bluestar on 11-20-2008 at 11:21 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On