mIRC Home    About    Download    Register    News    Help

Print Thread
Read lines from text file. #209517 16/02/09 08:00 PM
Joined: Feb 2009
Posts: 6
B
booth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2009
Posts: 6
How can I make this read more than one line?


Code:
on *:TEXT:!next:#: msg # $read(next.txt)



Re: Read lines from text file. [Re: booth] #209519 16/02/09 08:06 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
$read only reads once. do you want it to read more than once and msg more than once? if so, why not have the msg twice?

Last edited by pouncer; 16/02/09 08:07 PM.
Re: Read lines from text file. [Re: pouncer] #209521 16/02/09 08:33 PM
Joined: Feb 2009
Posts: 6
B
booth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2009
Posts: 6
I have 2 lines, the first line is never overwritten only the second. I want to read and msg to # both lines in 1 message.

Re: Read lines from text file. [Re: booth] #209523 16/02/09 08:38 PM
Joined: Jul 2006
Posts: 3,723
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,723
$read(file,1) return the first line of your file, $read(file,2) return the second line...


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Read lines from text file. [Re: booth] #209525 16/02/09 08:54 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Instead of reading one line, then messaging it, then reading the other line, then messaging it, use the /play command

See /help /play

This will be especially helpful if, in the future, you decide to increase the number of lines in the text file.

Re: Read lines from text file. [Re: RusselB] #209542 17/02/09 01:36 AM
Joined: Feb 2009
Posts: 6
B
booth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2009
Posts: 6
Thanks.

Re: Read lines from text file. [Re: booth] #209556 17/02/09 04:07 PM
Joined: Jun 2008
Posts: 58
P
Pivo Offline
Babel fish
Offline
Babel fish
P
Joined: Jun 2008
Posts: 58
I wonder why you actually want to read the first line if it doesn't ever change anyway...
You could simply /msg the text itself.