Log in

View Full Version : Repeating and colour checking



zluo
03-16-2012, 06:09 AM
Can anyone help me by explaining how to do these two simple things?

Repeat a procedure for an amount of times.

Check the colour of a specific pixel. If false redo procedure but if true move onto next procedure.

Flight
03-16-2012, 06:15 AM
Procedure LoopIt;
Var
i: Integer;
begin
for i := 0 to 100 do //Start at 0 and loop anything 100 times
begin
Writeln('Loop number '+IntToStr(i));
//Whatever else
end;
end;

Daniel
03-16-2012, 06:36 AM
Also:


if(GetColor(x, y) = colour) then
... // If the colour is found, do this.
else
... // otherwise do this.


:)

zluo
03-16-2012, 08:14 AM
Procedure LoopIt;
Var
i: Integer;
begin
for i := 0 to 100 do //Start at 0 and loop anything 100 times
begin
Writeln('Loop number '+IntToStr(i));
//Whatever else
end;
end;


so if i wanted a simple mouse click in there, where would i put it