Log in

View Full Version : FindColorRightTol Question



Fizzi
07-26-2007, 12:38 AM
I made a short script to test this procedure. Here it is:

program TestingScript;
{.include SRL/SRL.scar}
var
xb1, yb1, xb2, yb2 : Integer;

begin
SetupSRL;
FindMSColorTol(xb1, yb1, 4417653, 4);
FindColorRightTol(xb2, yb2, 4417653, MSX1, MSY1, MSX2, MSY2, 4);
Writeln(inttostr(xb1) + ', ' + inttostr(yb1));
Writeln(inttostr(xb2) + ', ' + inttostr(yb2));
end.


This was my screen:
http://img504.imageshack.us/img504/8961/wellfindcoltq1.png

The color in the script is a light brown, which is present in many places of the well.

This was my output:


Successfully compiled
SRL Compiled in 31msec.
195, 176
196, 176
Successfully executed


FindColorRightTol is supposed to search for a color from right to left correct? So shouldn't the color coming up for it be more like 276, 210? Does FindColorRightTol work properly, or do I not understand it's proper use?

itSchRis917
07-26-2007, 03:37 AM
Try lowering the tolerance, it might have found a shade of brown somewhere on the wall, or on the ground..
And if that still doesnt work, try searching for a color in a box of like 50 x 50 starting in the center of the screen..

Fizzi
07-27-2007, 07:23 PM
Try lowering the tolerance, it might have found a shade of brown somewhere on the wall, or on the ground..
And if that still doesnt work, try searching for a color in a box of like 50 x 50 starting in the center of the screen..

I've tried lowering the tolerance, that's not it. And I have a reason for wanting to search from the right, thanks for the suggestion though.

Pyro
07-27-2007, 08:12 PM
well just go

x:=msx2 // or however far you want

findcolorspiral(x,y,whatever

colorspiral spirals outwards from where ever the x and y variable are

Fizzi
07-28-2007, 03:56 PM
well just go

x:=msx2 // or however far you want

findcolorspiral(x,y,whatever

colorspiral spirals outwards from where ever the x and y variable are

Thank you! This will work.