Still keeping it simple and to your original post. I learn by comparing code, maybe you do as well
. Simple, and straight forward. Included two code. Your way, and a shorter way.
SCAR Code:
// Your Code modified
Program colorfinder;
{to find yellow balloon text button on pdf program
Begin at loc 22,556, Use Spiral colorfind until finding color for button.}
var x,y:integer;
function FindColor1: Boolean; // Boolean will return either true or false.
begin // the dimensions to look in (0,0 is top left)
if(FindColor(x,y,28460473, 0,0,999,999))then
begin
result := true; // we use := to assign values.
end else // otherwise... must contain begin statement. Also represents end of that begin
begin
result := false;
end;
end;
Procedure WriteLn1;
begin //once found color write in found color
if (FindColor1 = True) then // we don't use := here because it is comparing two variables.
begin
WriteLn('I have found what you were looking for :)')
TerminateScript;
end else
begin
writeln('Nope, not found');
end;
end;
begin
FindColor1
WriteLn1
end.
SCAR Code:
//How I would have done it
Program colorfinder;
var x,y:integer;
begin
If(FindColor(x,y,28460473,0,0,999,999))then
begin
Writeln('I have found what you were looking for :)');
end else
begin
Writeln('Nope, not found!');
end;
end.