mIRC Home    About    Download    Register    News    Help

Print Thread
/filter or? #263004 05/05/18 05:45 PM
Joined: Oct 2017
Posts: 14
K
Kex Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Oct 2017
Posts: 14
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

Re: /filter or? [Re: Kex] #263005 06/05/18 10:15 AM
Joined: Jul 2006
Posts: 3,582
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,582
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) { }


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /filter or? [Re: Wims] #263048 18/05/18 09:34 PM
Joined: May 2018
Posts: 3
A
AngelaN Offline
Self-satisified door
Offline
Self-satisified door
A
Joined: May 2018
Posts: 3
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.