What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Read Text from a file

Read Text from a file
Author: Message:
TehGoatLord
New Member
*


Posts: 12
Joined: Nov 2010
O.P. RE: Read Text from a file
This is what I did.. But the command isn't recognized D:


code:
function ReadLineFromFile(sFile, nLine) {
    var f = new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(sFile, 1 /* ForReading */);
    var s = f.ReadAll();
    f.Close()
    var FileContents = s.split('\r\n');
    return FileConents(nLine-1);
}

function OnEvent_ChatWndSendMessage() {

var m;
if ( m = /^\/([^ \n\r\v\xA0\/][^ \n\r\v\xA0]*)[\s\xA0]?([\s\S]*)/.exec(sMessage) ) {
    var command = m[1].toLowerCase();
    var parameter = m[2];
    if ( command == 'acserv' ) {
    var line = ReadLineFromFile("C:\\Program Files\\AssaultCube_v1.1.0.3\\config\\saved.cfg", 255);
// line now contains the 255th line from saved.cfg

line = line.replace('alias "serverinfo [', '');
line = line.replace(']', '');
    }
}
return sMessage;
}



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

Messages In This Thread
Read Text from a file - by TehGoatLord on 11-07-2010 at 02:51 AM
RE: Read Text from a file - by matty on 11-07-2010 at 03:40 AM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 04:47 AM
RE: Read Text from a file - by Matti on 11-07-2010 at 10:11 AM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 02:02 PM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 02:04 PM
RE: Read Text from a file - by matty on 11-07-2010 at 02:10 PM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 04:47 PM
RE: Read Text from a file - by whiz on 11-07-2010 at 05:24 PM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 06:09 PM
RE: Read Text from a file - by matty on 11-07-2010 at 06:30 PM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 06:48 PM
RE: Read Text from a file - by Matti on 11-07-2010 at 07:42 PM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 08:01 PM
RE: Read Text from a file - by matty on 11-07-2010 at 08:07 PM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 08:14 PM
RE: Read Text from a file - by Matti on 11-07-2010 at 08:22 PM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 08:30 PM
RE: Read Text from a file - by Matti on 11-07-2010 at 08:42 PM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 08:51 PM
RE: Read Text from a file - by Matti on 11-07-2010 at 10:36 PM
RE: Read Text from a file - by TehGoatLord on 11-07-2010 at 10:45 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