mIRC Home    About    Download    Register    News    Help

Print Thread
#90182 12/07/04 01:00 PM
Joined: Jun 2004
Posts: 10
U
Uradox Offline OP
Pikka bird
OP Offline
Pikka bird
U
Joined: Jun 2004
Posts: 10
I have a small problem with reading a txt file.
I am trying to read a txt file and msg a chan with EVERY line that starts with !SUPPLY. From what iv read in the mirc help file i can only read the first line it finds ;\
msg $chan $read(list.txt, s, !SUPPLY)
Say then also is it possible to delete a line from the txt file if it say contains something like *old news* ?

#90183 12/07/04 02:39 PM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
put all lines that start with !SUPPLY in a separate text file and use /play (see /play in the help files)


I refuse to engage in a battle of wits with an unarmed person. wink
#90184 13/07/04 11:28 AM
Joined: Jun 2004
Posts: 10
U
Uradox Offline OP
Pikka bird
OP Offline
Pikka bird
U
Joined: Jun 2004
Posts: 10
ah yes of course, i feel a bit foolish now such a simple solution.
Now to remove lines request smile sure the help file will mention this clearly

#90185 14/07/04 06:22 PM
Joined: Jul 2004
Posts: 12
G
Pikka bird
Offline
Pikka bird
G
Joined: Jul 2004
Posts: 12
hmmm, well i haven't really tried that. But if it only gives you a result once, just put it into a while loop.
Code:
%i = 1
%j = $lines(file.txt)
while (%i < %j) {
%text = $read(file.txt , %i)
if (!word isin %text) {
msg # %text
return
}

inc %i
}


Last edited by Grumpy; 14/07/04 06:23 PM.
#90186 14/07/04 08:27 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
An easier way would be:

alias intplay {
if ($2 == !SUPPLY) { msg $1 $2- }
}

And simply, /play -a /intplay #CHANNEL FILENAME.txt

Changing, both FILENAME.txt and #CHANNEL, that way you wouldnt have to have seperate files.

Eamonn.


Link Copied to Clipboard