mIRC Home    About    Download    Register    News    Help

Print Thread
$read colors from a text file #28552 07/06/03 12:05 PM
Joined: Jan 2003
Posts: 25
N
NoScRiPtR Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Jan 2003
Posts: 25
I need to read random lines from a text file (I know how to do this) with different color combinations for each line (I don't know how to do this).
Each line would have it's own control and color codes (some bold as well).
Is there something I've missed in the help files?


But then again, what do I know ... I'm NoScRiPtR wink
Re: $read colors from a text file #28553 07/06/03 12:10 PM
Joined: May 2003
Posts: 730
S
ScatMan Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
if i get u right, u want a random color for the line that has read
then do
$chr(3) $+ $r(1,15) $+ $read(file.txt)
if there is a case that the first letter in the file will be a number so better to use $base($r(1,15),10,10,2) except $r(1,15) so the number will be in double digit format

Re: $read colors from a text file #28554 07/06/03 12:13 PM
Joined: Dec 2002
Posts: 774
T
theRat Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
$+(<ctrl+k>,$r(0,15),$chr(44),$r(0,15) , $iif($r(0,1),<ctrl+b>) , $iif($r(0,1),<ctrl+u>) , $iif($r(0,1),<ctrl+r>) , $read(file.txt))


Code:
//if ( khaled isgod ) echo yes | else echo no
Re: $read colors from a text file #28555 07/06/03 12:16 PM
Joined: Jan 2003
Posts: 25
N
NoScRiPtR Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Jan 2003
Posts: 25
I want to be able to get the colors from the text file itself.
Each line will have it's own specific colors, but the lines will be randomly selected.
ex:
08,01 TEXT HERE 00,01 more text here


But then again, what do I know ... I'm NoScRiPtR wink
Re: $read colors from a text file #28556 07/06/03 12:19 PM
Joined: Mar 2003
Posts: 272
C
c0ldfusi0n Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
If that's your syntax, it should appear in color if you simply use $read since the control code is stored and the file.


- cF
Dedicated helper for rent.
Re: $read colors from a text file #28557 07/06/03 12:35 PM
Joined: Jan 2003
Posts: 25
N
NoScRiPtR Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Jan 2003
Posts: 25
Should, but don't for some reason ... gets the text, but no formatting (mirc6.03, btw)
script follows:

.random: {
%lastcolor = $readini(my.ini,lastcolor,last)
inc %lastcolor 1
if (%lastcolor > 50) %lasttopic = 1
writeini my.ini lastcolor last %lastcolor
msg $chan $read(lastcolor.txt,%lastcolor)
}

this reads them sequentially (rather than randomly) but should STILL pick the color codes out, shouldn't it?



But then again, what do I know ... I'm NoScRiPtR wink
Re: $read colors from a text file #28558 07/06/03 05:29 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
/write test.txt 3,4test
//echo -a $read(test.txt)

That prints in color for me. Are you sure lastcolor.txt has color codes? Are you sure you don't have color code stripping enabled?

Re: $read colors from a text file #28559 08/06/03 11:15 AM
Joined: Jan 2003
Posts: 25
N
NoScRiPtR Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Jan 2003
Posts: 25
I'm positive the text has color codes .. and I don't strip colors


But then again, what do I know ... I'm NoScRiPtR wink
Re: $read colors from a text file #28560 08/06/03 06:18 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
well if you type //echo -a $read(the.file.name) does it use color codes?

Re: $read colors from a text file #28561 08/06/03 10:46 PM
Joined: Jan 2003
Posts: 25
N
NoScRiPtR Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Jan 2003
Posts: 25
yes it did .. I reinstalled mirc6.03 to a new folder and it works now .. go figure

thanks for trying, anyway


But then again, what do I know ... I'm NoScRiPtR wink