AHAAA! I WIN!!! i took out the boxes so now it looks like this instead...
SCAR Code:
Box1 := IntToBox(MTPA1.x-40, MTPA1.y-100, MTPA1.x, MTPA1.y+100);
Box2 := IntToBox(MTPA1.x, MTPA1.y-100, MTPA1.x + 40, MTPA1.y+100)
///... later on
for h := 0 to HighTPA do
begin
Side1 := PointInBox(TPA2[h], Box1);
Side2 := PointInBox(TPA2[h], Box2);
writeln(inttostr(TPA2[h].x));
writeln(inttostr(TPA2[h].y));
end;
edit for anyone who cares, this is the finished thing
SCAR Code:
function ClimbRope : Boolean;
var
i, h, hightpa : Integer;
TPA, TPA2 : TPointArray;
ATPA, ATPA2 : T2DPointArray;
Side1, Side2 : Boolean;
MTPA1, MTPA2 : TPoint;
Box1, Box2 : TBox;
begin
Box1 := IntToBox(MTPA1.x-40, MTPA1.y-100, MTPA1.x, MTPA1.y+100);
Box2 := IntToBox(MTPA1.x, MTPA1.y-100, MTPA1.x + 40, MTPA1.y+100)
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2900815, MSX1, MSY1, MSX2, MSY2, 30);
FindColorsSpiralTolerance(MSCX, MSCY, TPA2, 922905, MSX1, MSY1, MSX2, MSY2, 30);
ATPA := TPAToATPA(TPA, 50);
SortATPASize(ATPA, true);
ATPA2 := TPAToATPA(TPA2, 50);
SetLength(TPA2, Length(ATPA));
for h := 0 to high(ATPA2) do
begin
TPA2[h] := MiddleTPA(ATPA2[h]);
end;
highTPA :=Length(TPA2) - 1;
SetLength(ATPA2, 0);
for i := 0 to High(ATPA) do
begin
MTPA1 := MiddleTPA(ATPA[i]);
for h := 0 to HighTPA do
begin
Side1 := PointInBox(TPA2[h], Box1);
Side2 := PointInBox(TPA2[h], Box2);
end;
if Side1 and Side2 then
begin
TPA[0] := MiddleTPA(ATPA[i]);
MMouse(tpa[0].x, tpa[0].y, 0, 0);
wait(50);
if isuptext('limb') then
begin
Mouse(tpa[0].x, tpa[0].y, 0, 0, false);
if ChooseOption('limb') then
begin
fflag(0);
result := true;
exit;
end;
end;
end;
Side1 := false;
Side2 := false;
end;
end;