mIRC Home    About    Download    Register    News    Help

Print Thread
#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

Kex #263005 06/05/18 10:15 AM
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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) { }


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #263048 18/05/18 09:34 PM
Joined: May 2018
Posts: 3
A
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.


Link Copied to Clipboard