mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 25
N
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
Joined: May 2003
Posts: 730
S
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

Joined: Dec 2002
Posts: 774
T
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
Joined: Jan 2003
Posts: 25
N
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
Joined: Mar 2003
Posts: 272
C
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.
Joined: Jan 2003
Posts: 25
N
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
Joined: Dec 2002
Posts: 2,809
C
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?

Joined: Jan 2003
Posts: 25
N
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
Joined: Dec 2002
Posts: 2,809
C
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?

Joined: Jan 2003
Posts: 25
N
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

Link Copied to Clipboard