mIRC Homepage
Posted By: henkie33 write particular lines to .txt file - 21/11/06 09:44 PM
Hello,

I want to write all the lines containing [test] written by a user called 'bot' in #mybotchan written to a .txt file.
I tried to script it by using this forum but it doesnt seem to work.

Code:
on *:TEXT:*[test]*:#mybotchan:{
if ($nick == bot) {
  /write BOTDB.txt $1-
}
}


Anyone?

Thanks!
Posted By: Riamus2 Re: write particular lines to .txt file - 21/11/06 10:33 PM
Are there colors, or bold/underline, in [test]? Does test always have []'s around it?

As a note, you never need /'s in a script.
Posted By: henkie33 Re: write particular lines to .txt file - 21/11/06 10:44 PM
Yes there are color's included, but i tried * so that shouldnt make a difference, yes there are always []'s around it.
Posted By: billythekid Re: write particular lines to .txt file - 21/11/06 10:46 PM
try
Code:
 
on *:TEXT:*:#mybotchan:{
if ($nick == bot) && ( $+($chr(91),test,$chr(93)) isin $1- ) {
  /write BOTDB.txt $1-
}
} 
Posted By: Riamus2 Re: write particular lines to .txt file - 21/11/06 11:15 PM
Best to use $strip with that...

Code:
on *:TEXT:*:#mybotchan:{
  if ($nick == bot && $+($chr(91),test,$chr(93)) isin $strip($1-)) {
    write BOTDB.txt $1-
  }
} 
Posted By: billythekid Re: write particular lines to .txt file - 21/11/06 11:51 PM
yeah agreed, was having a brain fart there, was actually, and don't laugh, gonna do *[*t*e*s*t*]*

crazy
Posted By: henkie33 Re: write particular lines to .txt file - 22/11/06 04:10 PM
hmm it still doesnt work :S, i really tried everything.. Already created .txt file with that name, but it really doesnt write anything to it :S

Im really helpless now..
Posted By: xDaeMoN Re: write particular lines to .txt file - 22/11/06 06:02 PM
Try putting it on a new remote file. Maybe another On text event is conflicting with it.
Posted By: henkie33 Re: write particular lines to .txt file - 23/11/06 04:35 PM
Thanks that worked!
© mIRC Discussion Forums