whoops, in line 69 you might have to correct the if().
oh, and btw every time you log a message it will stay at the same time that you started the script
code:
if (JustSentAMessage = false){
change the "=" to "==" or an even better one is "===" (bitwise).
put variable fsObj as a 'local' variable under AddLineToFile() function.
i don't see the variable being used in other functions...
also, what your code basically to me is just:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message){
Origin = MsgPlus.RemoveFormatCodes(Origin).substr(0,17);
Message = MsgPlus.RemoveFormatCodes(Message);
var now = new Date();
var h = now.getHours()+1;
var m = now.getMinutes()+1;
var s = now.getSeconds()+1;
var mo = now.getMonth()+1;
var d = now.getDate();
var y = now.getFullYear();
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var file = FSO.OpenTextFile(MsgPlus.ScriptFilesPath + "\\Log "+mo+"-"+d+"-"+y+".txt", 8, 1);
file.WriteLine("["+h+":"+m+":"+s+"] "+Origin+": " + Message);
file.Close();
}
though it may not work because i haven't tested it, it just shows how you can create the basic functionality of your big script into just one function.