mIRC Home    About    Download    Register    News    Help

Topic Options
#263004 - 05/05/18 06:45 PM /filter or?
Kex Offline
Nutrimatic drinks dispenser

Registered: 21/10/17
Posts: 6
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

Top
#263005 - 06/05/18 11:15 AM Re: /filter or? [Re: Kex]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3300
Loc: France
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

Top
#263048 - 18/05/18 10:34 PM Re: /filter or? [Re: Wims]
AngelaN Offline
Self-satisified door

Registered: 16/05/18
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.

Top