rj
2013-05-22 22:40:40
Ok, so I am trying to make a function to check to see if colors changed:
But it does not work for some reason, I tested it on paint what the hell am I doing wrong?
{$i srl/srl.simba}
Var
s_Points:TPointArray;
function pointsChanged(pnts:TPointArray): Integer;
Var
c, i, t, matched:Integer;
begin
MarkTime(t);
repeat
for i:=0 to high(pnts) do
begin
c := GetColor(pnts[i].x,pnts[i].y);
if (c = (GetColor(pnts[i].x,pnts[i].y))) then matched:=matched+1;
end;
try
result := Round((matched)/(high(pnts)*100));
exit;
except
writeln('Error calculating');
exit;
end;
until (TimeFromMark(t)>500)
end;
begin
s_Points := [Point(0,0),Point(1,1)];
repeat
wait(100)
until(pointsChanged(s_Points)>10)
end.But it does not work for some reason, I tested it on paint what the hell am I doing wrong?