Log in

View Full Version : FindTPAInTPA



Main
11-05-2011, 12:02 AM
I've been trying to find some way to make the script tell me if my MOUSE POSITION is in a tpa with findtpaintpa.

I couldn't get this working (on the below picture ) no matter what, it keeps on telling me tpa matched...:(

http://img843.imageshack.us/img843/3749/testil.png
program TPA;
{$i SRL\SRL.scar}
{$i SRL\SRL\misc\Debug.scar}

Var
TP, MSCP, MSEP: Tpoint;
OldDB: String;

Procedure FindWaterBound;
Var
TP : Tpoint;
TPA, RandomTPA: TPointArray;
Begin
GetClientDImensions( MSEP.X, MSEP.Y);
If FindColorsSpiralTolerance( TP.X, TP.Y, TPA, 16711422, 0, 0, MSEP.X - 1, MSEP.Y - 1, 200) Then
Begin
DebugTPA( TPA, '');
Repeat
GetMousePos( TP.X, TP.Y);
If FindTPAInTPA( [TP], TPA, RandomTPA) Then
Disguise( 'TPA matched')
Else
Disguise( 'TPA did not match');
Until False
End;
End;

Begin
SetupSRL;
MouseSpeed := 999;
FindWaterBound;
End.

Zyt3x
11-05-2011, 12:05 AM
GetMousePos(P.X, P.Y);
PointInTPA(P, TPA);

?

Wizzup?
11-05-2011, 12:06 AM
FindTPAinTPA returns true if the first TPA points are found in the second one. That is, if P1.x == P2.x and P1.y == P2.y. It doesn't check if they are ``in the area of the tpa''. You'll need other functions for that.

Regardless, I think this should work? Did you trying printing out the mouse location? Perhaps the value is something you don't expect.

Main
11-05-2011, 01:00 AM
I did try the print mouse thing. But Zyt3x i'll try that fo sho tomorrow:P