Yanhua
2011-12-28 19:02:32
Hello Scripters,
I'm kind of new to using TPAs, and would like to ask for some guidance.
Well, I need to get the door. :)
So far, I've got this.

This is my procedure. Is there a way to make it filter out all the TPAs in the ATPA except for the door?
I'm kind of new to using TPAs, and would like to ask for some guidance.
Well, I need to get the door. :)
So far, I've got this.

This is my procedure. Is there a way to make it filter out all the TPAs in the ATPA except for the door?
Procedure HandleDoor;
Var
Door:TPointArray;
B:TBox;
ATPA:T2DPointArray ;
Begin
If FindColorsSpiralTolerance(MSCX, MSCY, Door, 2172458, MSX1, MSY1, MSX2, MSY2, 0) Then
Begin
B := GetTPABounds(Door);
ATPA:=TPAtoATPAEx(Door, 15, 10000);
DebugATPABounds(ATPA);
MouseBox(B.X1, B.Y1, B.X2, B.Y2, 2);
If IsUpText('pen') Then
Begin
WriteLn('The door is Closed. We are going to open it.');
MouseBox(B.X1, B.Y1, B.X2, B.Y2, 1);
end else
If IsUpText('ose') Then
Begin
WriteLn('The door is Open. We are OK to proceed.');
end;
end;
end;