So when I do FindDTM or something similar the script will search from top left to bottom right. How can I reverse it so that it searches from bottom right to top left?
So when I do FindDTM or something similar the script will search from top left to bottom right. How can I reverse it so that it searches from bottom right to top left?
You can't without rewriting the FindDTM code, but you can do something like this:
Simba Code:Function FindMyDTMBottomRight : TPoint;
Var
MyDTM : integer;
Points : array of TPoint;
begin
MyDTM := DTMFromString('ehnfsdn'); //Defining your DTM;
FindDTMs(MyDTM, Points, MSX1, MSY1, MSX2, MSY2); //Searches for it and stores every time it find it in "Points"
FreeDTM(MyDTM); //Free the DTM
if(GetArrayLength(Points) = 0)then //if it didn't find it then the array length will be 0 so it exits
exit;
SortTPAFrom(Points, Point(MSX2, MSY2)); //it sorts the points from the bottom right of the screen
Result := Points[0]; //so the bottom right point will now be the first one
end;
If you don't understand anything feel free to ask...
Yeah it's best to use main screen X and Y so it starts from middle.
You'd want to use something like this in your script. Usage is exactly the same as regular FindDTM. The "bu" at the end stands for "bottom up".
Simba Code:function FindDTMbu(DTM: Integer; var x, y: Integer; const x1, y1, x2, y2: Integer): Boolean;
var
tempTPA: TPointArray;
begin
Result := FindDTMs(DTM, tempTPA, x1, y1, x2, y2);
if(not(Result)) then
Exit;
InvertTPA(tempTPA);
x := tempTPA[0].x;
y := tempTPA[0].y;
end;
![]()
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
There are currently 1 users browsing this thread. (0 members and 1 guests)