Hey i just started to learn TPA scripting yesterday but im not quite sure if i formatted this correctly. could someone look to see if i did this correctly?
SCAR Code:
function FindColorObjectInvTPA(color:integer);
var
OC: array of Tpoint;
Set,I,C,AR,B: integer;
begin
SetArrayLength(Oc,4);
AR:=getarraylength(oc[i])
C:=10;
Set:=High(Oc);
FindColorsSPiralTolerance(x,y,OC,COLOR,MIX1,MIY1,MIX2,MIY2,C);
fo i:=0 to Set do
begin
if AR>=2 then
begin
repeat
B:=B+1;
C:=C-1;
FindColorsSPiralTolerance(x,y,OC,COLOR,MIX1,MIY1,MIX2,MIY2,C);
until(AR=1)or (b=5)and(Ar>=2);
end;
if AR=1 then
begin
Mouse(x,y,1,1,true);//clicks on object
end;
if B=5 and AR>=2 then
begin
MiddleTPAEx(Oc[i],x,y); //haha this is my idea of randomly XD
Writeln('There are More than 1 Objects with the same color!');
Writeln('Choosing one Randomly!');
Mouse(x,y,1,1,true);
end;
end;
end;
alright wat it simply should do is taht it finds the color of an object and tries to single it out by lowering the tolerance so that the array length goes down to 1. if not then it would pick the "middle?"( if i used middleTPAEx function in the right cirumstances)of the points. As i said i kinda just learned the formalities of TPA scripting not too long ago. =( BUT the problem is taht this would only find POINTS not objects with the colors. how would i make it that it would find OBJECTS with those colors rather than just points?