mIRC Homepage

$read colors from a text file

Posted By: NoScRiPtR

$read colors from a text file - 07/06/03 12:05 PM

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?
Posted By: ScatMan

Re: $read colors from a text file - 07/06/03 12:10 PM

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
Posted By: theRat

Re: $read colors from a text file - 07/06/03 12:13 PM

$+(<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))
Posted By: NoScRiPtR

Re: $read colors from a text file - 07/06/03 12:16 PM

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
Posted By: c0ldfusi0n

Re: $read colors from a text file - 07/06/03 12:19 PM

If that's your syntax, it should appear in color if you simply use $read since the control code is stored and the file.
Posted By: NoScRiPtR

Re: $read colors from a text file - 07/06/03 12:35 PM

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?

Posted By: codemastr

Re: $read colors from a text file - 07/06/03 05:29 PM

/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?
Posted By: NoScRiPtR

Re: $read colors from a text file - 08/06/03 11:15 AM

I'm positive the text has color codes .. and I don't strip colors
Posted By: codemastr

Re: $read colors from a text file - 08/06/03 06:18 PM

well if you type //echo -a $read(the.file.name) does it use color codes?
Posted By: NoScRiPtR

Re: $read colors from a text file - 08/06/03 10:46 PM

yes it did .. I reinstalled mirc6.03 to a new folder and it works now .. go figure

thanks for trying, anyway
© 2020 mIRC Discussion Forums