Hey I was going through my old script and updating all my procedures to work with SRL6. So I have everything else working fine, but I'm stuck on this one line of one of my procedures.
So the problem at hand is the balance beam TPA needs to have a specific part clicked on. In-game it has 3 segments. The one closest to the player is clickable, the one in the middle isn't, and the one furthest away is "out of reach". So my original solution was to take my ATPA[0] since my ATPA was sorted by size, use the Bounds of the top left corner(X1,Y1) and add 25 to X1 and 2 to Y1 to create a MouseBox that would click on only that portion.
Here's a picture of how it used to work...
The line of code to generate what I wanted(outdated)...
Simba Code:
Mousebox(GetTPABounds(BalanceATPA[0]).X1, GetTPABounds(BalanceATPA[0]).Y1, GetTPABounds(BalanceATPA[0]).X1 + 25, GetTPABounds(BalanceATPA[0]).Y2 + 2, 2);
And an example of the procedure as I have it updated without that line since I don't know what to do.
Simba Code:
procedure colorCheck3;
var
x,y:Integer;
BalanceTPA:TPointArray;
BalanceATPA:T2DPointArray;
begin
if findColorsSpiralTolerance(x, y, BalanceTPA, 4809844, mainScreen.getBounds(), 5, colorSetting(2, 0.1, 0.2)) then
begin
BalanceATPA := BalanceTPA.toATPA(30, 30);
BalanceATPA.sortBySize(true);
smartImage.debugTPA(BalanceTPA, true);
smartImage.debugATPA(BalanceATPA);
//mouseBox(GetTPABounds(BalanceATPA[0]).X1, GetTPABounds(BalanceATPA[0]).Y1, GetTPABounds(BalanceATPA[0]).X1 + 25, GetTPABounds(BalanceATPA[0]).Y2 + 2, 2);
wait(150 + random(25));
if isMouseOverText(['alanc']) then
begin
wait(150 + random(50));
fastClick(MOUSE_LEFT);
writeLn('Found Balance!');
smartImage.clear;
wait(150 + random(50));
minimap.setAngle(MM_DIRECTION_EAST);
Wait(2700 + random(100));
end;
end;
end;
Lost as to what to do for this, any help is welcome.
*Edit*
Just to further explain. I have ATPA[0] as shown in white in the picture. I want to get the coordinates(used to be X1,Y1) of the top left of the bounds, and create a tbox with those coordinates as X1,Y1,X1+25,Y1+2, and then click within that tbox(which is the purple clickable area).