mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2003
Posts: 38
S
snabbi Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2003
Posts: 38
code to reproduce:
//write -c whatever.txt 1 | write whatever.txt 2 | write whatever.txt 3 | play # whatever.txt 2000 | remove whatever.txt

It is probably treating the first line as the number of lines in the file, but this value is then ignored and all lines are read. I am using 6.2

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You have correctly identified what's happening.
As to why it's happening, the /play command performs a $read of each line in the file (subject to the parameters provided in the /play command), then sends the read line to the nick/channel

Because it performs a read, this is relevant
Quote:
If the first line in the file is a number, it must represent the total number of lines in the file.
Quoted from /help $read

Joined: Sep 2003
Posts: 38
S
snabbi Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2003
Posts: 38
I know that the option -t is in $read to treat the text as plain text and i think mIRC should use the -t switch because /play doesn't use the number of lines.

In my opinion it should either read the first line and treat the file as if it had so much lines, or it should treat the first line as a plain text value.

Joined: Feb 2004
Posts: 201
J
Jae Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2004
Posts: 201
Quote:
I know that the option -t is in $read to treat the text as plain text and i think mIRC should use the -t switch because /play doesn't use the number of lines.


"The -t switch forces mIRC to look up the specified topic in the file and play all lines under that topic."

quoted from /help /play

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
as a side note, you can access the first line when its a number with $read(filename,0) as mIRC will consider the number as indicated to be the number of lines in the text.
while I have never used the feature, my guess is to make reading a specific line faster in the file when mIRC knows in advance how many lines there are to read through. Maybe someone can illuminate this function?

Joined: Sep 2003
Posts: 38
S
snabbi Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2003
Posts: 38
The bug is also in version 6.21

Maybe I should clarify what I mean. Although you can use the -t option in $read to specify that the line should be treated as text, this option is not available in the /play command.

The only workaround here is to "play" commands with the -c option and read the text.

Another thing I would like to add is that if /play is using $read internally, this should probably be replaced with a /fopen $fread /fclose loop.


Link Copied to Clipboard