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;
}