What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » why my scripts can not work?

why my scripts can not work?
Author: Message:
Hijhon
New Member
*


Posts: 3
Joined: Aug 2006
O.P. Huh?  why my scripts can not work?
quote:
var txtFilepath;
var refreshtime;

function OnEvent_Initialize(MessengerStart)           //开始登陆后执行
{
    txtFilepath = MsgPlus.ScriptFilesPath + "\\" + "song.txt";
    refreshtime = 2000;
    loadtext();
    OnEvent_Timer(ChangeTime);
}


function OnEvent_Timer(TimerId){                      //时间触发器
if(TimerId == "ChangeTimer") {
         Messenger.MyPersonalMessage = txtline[i];
        MsgPlus.AddTimer("ChangeTimer", refreshtime);
        A++;
        if (A==i)
        {
            loadtext()
        }
}
}

function OnEvent_Uninitialize(MessengerExit)
{
   // 清理内存
   Shell = null;
   FileSystem = null;
   Settings = [];
}

function loadtext()  //读取文本内容
{
    var shell
    var filesystem
    var txtfile
    var txtline
    var i = 0;
    var error = false;
    Shell = new ActiveXObject("WScript.Shell");
    FSO = new ActiveXObject("Scripting.FileSystemObject");
    txtFile = FSO.OpenTextFile(Settings['txtFilepath']);
    if(!error) {
        do {
            txtline[i] = txtfile.ReadLine();
            i++;
        }while(!error);
        NameFile.Close();
    }

}
08-17-2006 01:23 PM
Profile E-Mail PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: why my scripts can not work?
it always helps when you tell us whats wrong with it
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
08-17-2006 01:25 PM
Profile PM Web Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: why my scripts can not work?
For starters "i" needs to be a global variable to be able to be used in multiple functions (placed outside of a function).  shell and filesystem are made valid variables and not used while var isn't put infront of Shell and FSO when they are being defined.  They were some problems I noticed quickly.  You may also want to refer to your syntax error in the script debugging window to understand where mistakes have been made (it would also pay to tell use what the error says there so we can have more understanding at a quicker look).
[Image: markee.png]
08-17-2006 01:30 PM
Profile PM Find Quote Report
Hijhon
New Member
*


Posts: 3
Joined: Aug 2006
O.P. RE: why my scripts can not work?
nothing display when I run this script.
I do not know whats wrong with it,PLZ help me.
I am newbie!
thanks!!
08-17-2006 01:32 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: why my scripts can not work?
Make sure that the checkbox "Enable debugging options" in the Scripts tab of the General section in the Plus! Live preferences window is checked and then try to add
code:
Debug.DebuggingWindowVisible = true;
on the first line of your script to open the debugging window. Select your scripts name in the dropdownlist and then copy the contents of the textbox and paste them here, so we can see what's really going on with it. :)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-17-2006 03:49 PM
Profile E-Mail PM Web Find Quote Report
Hijhon
New Member
*


Posts: 3
Joined: Aug 2006
O.P. RE: why my scripts can not work?
Ok,I try it,thanks!
08-18-2006 04:26 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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