An example to help you out:
x,y = where the coordinate will be stored if the color is found in the box
5401208 = the color
257,183 = top left corner of box to search for the color in
281,237 = bottom right corner of box
4 = tolerance
SCAR Code:
if FindColorSpiralTolerance(x, y, 5401208, 257, 183, 281, 237, 4) then
begin
MMouse(x, y, 2, 2);//Will move the cursor to the color it found. The 2's are for randomness.
if IsUpText(whatever the uptext is) then
begin
Mouse(x, y, 1, 1, false);//False right clicks.
ChooseOption('Open' or w/e);//Open would be for a door or a gate.
end else Writeln('Didn''t find the proper uptext');
end else Writeln('Didn''t find the specified color in the given parameters.');