What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Help] Writing text

[Help] Writing text
Author: Message:
uNDeRGRouND99
New Member
*


Posts: 10
Joined: Jun 2008
O.P. [Help] Writing text
Hi, i'm new and i'm a programmer of VB.Net and other, so i know how to program, so and so also in Script Plus.
My question is:
Why this don't work?

code:
function AddLineToFile (file, line) {
  if (!fsObj.FileExists(MsgPlus.ScriptFilesPath + '\\' + file))
    var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 2, 1);
      else
        var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 8, 0);
  fileObj.WriteLine(line);
  fileObj.Close();
}

I want a function for create a .txt and put in what i press (like keylogger) and upload it with ftp.
If i use AddLineToFile("lol.txt","hi"); for example, it don't work.

PS: MsgPlus.ScriptFilesPath is C:\Program Files\Messenger Plus! Live\Scripts\NameOfScript?
06-26-2008 08:00 AM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: [Help] Writing text
It would have been helpful if you could provide the result of the script debugger, since now I have to guess what went wrong in your code. ;)

Anyway, assuming that fsObj is correctly defined as a FileSystemObject in the global scope, I firstly recommend you to remove the check of FileExists(). This is already implemented if you set the create attribute to true, and thus there's no need to check it yourself:
code:
var fsObj = new ActiveXObject("Scripting.FileSystemObject");

function AddLineToFile (file, line) {
  var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, /*ForAppending*/ 8, /*Create*/ 1);
  fileObj.WriteLine(line);
  fileObj.Close();
}
I don't know what else might be wrong with your code... :-/
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-26-2008 12:15 PM
Profile E-Mail PM Web Find Quote Report
uNDeRGRouND99
New Member
*


Posts: 10
Joined: Jun 2008
O.P. RE: [Help] Writing text
Yea, work, u are pr0.
06-26-2008 01:43 PM
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