SRL Archive - Help

FindTPAInTPA


Main

2011-11-04 20:02:46

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…:(

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.

Gu3st...

2011-11-04 20:05:55

GetMousePos(P.X, P.Y);
PointInTPA(P, TPA);

?

Wizzup?

2011-11-04 20:06:33

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

2011-11-04 21:00:57

I did try the print mouse thing. But Zyt3x i'll try that fo sho tomorrow:P