SRL Archive - OSR Help

Just a question


Death12652

2010-12-09 00:30:50

Is this possible…


program new;
var
X, Y : Integer;
A : TIntegerArray;
begin
A := [10800001, 28800000]
FindColor(X, Y, A, 0, 50, 25, 75);
end.

I know it doesnt work but is there a similar way to call upon A as the color and it tries each of the colors?

i luffs yeww

2010-12-09 00:43:01

Yup! :) Try loops; they're very helpful.


var
x, y, i: Integer;
a: TIntegerArray;
begin
a := [10800001, 28800000];
for i := 0 to Length(a) - 1 do
if(FindColor(x, y, a[i], 0, 50, 25, 75))then
Break;
Writeln('Found color ' + ToStr(GetColor(x, y)) + ' at ' + ToStr(x) + ', ' + ToStr(y));

:) Hope that helps. Loops are quite useful.

Death12652

2010-12-09 00:47:10

I still get a type mismatch at the if(FindColor( part. Can you give me an example that works? Just so I can get an idea of how they work.

BraK

2010-12-09 00:47:51

From: i luffs yeww
Yup! :) Try loops; they're very helpful.


var
x, y, i: Integer;
a: TIntegerArray;
begin
a := [10800001, 28800000];
for i := 0 to Length(a) - 1 do
if(FindColor(x, y, a, 0, 50, 25, 75))then
Break;
Writeln('Found color ' + ToStr(GetColor(x, y)) + ' at ' + ToStr(x) + ', ' + ToStr(y));

:) Hope that helps. Loops are quite useful.


Think you missed a part there Ian. :p The brackets using the i as a integer. Here's the correction iirc.


var
x, y, i: Integer;
a: TIntegerArray;
begin
a := [10800001, 28800000];
for i := 0 to Length(a) - 1 do
if(FindColor(x, y, a[i], 0, 50, 25, 75))then
Break;
Writeln('Found color ' + ToStr(GetColor(x, y)) + ' at ' + ToStr(x) + ', ' + ToStr(y));


~BraK

Death12652

2010-12-09 00:48:46

Thanks that helps so much in my script.

BraK

2010-12-09 00:52:25

Not a problem but you should check out TPAs and using Findcolors. It's a lot more accurate.

~BraK

i luffs yeww

2010-12-09 00:52:30

Oh crap! :p Sorry. :x Yeah, it'd be a, as a is an array. >_<

Thanks, BraK.

Death12652

2010-12-09 01:00:23

Nevermind if you saw the post that was here. I figured it out. And I use TTA's and Findcolors.