mIRC Homepage
Posted By: Kex /filter or? - 05/05/18 05:45 PM
Hello everyone, i have example working code:
Code:
on *:TEXT:!CommandForAddUrl*:#: { write fileWithAddedInfo.txt Added: $nick : $2-
  msg $chan You done it, i am write it!  $nick $+ ! 
}


It worked, but this code not doing two things:

1)does not filter the file before writing, for finding matches url and if he found matches, he write about that in $chan and will not write this url in file.

2)Does not ignore empty message, just write empty line.

I correctly understand that this can be done with / filter ? where can I embed this part of the code
Posted By: Wims Re: /filter or? - 06/05/18 10:15 AM
You can use $read() to check if a line exist in a file, which is what you want to do here.

To prevent emptiness in parameters, you can check against $null: if ($2 == $null) { }
Posted By: AngelaN Re: /filter or? - 18/05/18 09:34 PM
Originally Posted By: Wims
You can use $read() to check if a line exist in a file, which is what you want to do here.

To prevent emptiness in parameters, you can check against $null: if ($2 == $null) { }


Thank you, I needed the help as well.
© mIRC Discussion Forums