RE: Help with code
iirc, activexobjects aren't recommended to be defined as a global variable
try this (looking at your code..):
jscript code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind){
if(Origin!=Messenger.MyName){
var file=new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(MsgPlus.ScriptFilesPath+"\\text.txt",1,1);
var text=file.ReadAll().split("\r\n");
file.close();
for(i in text)if(new RegExp(text[i],"i").test(Message)){
ChatWnd.SendMessage(text[Math.floor(Math.random()*text.length)]);
break;
}
}
}
This post was edited on 11-05-2008 at 06:59 PM by roflmao456.
[quote]
Ultimatess6: What a noob mod
|