Originally Posted by
3Garrett3
@
SlipperyPickle; Do you mind posting your function for the buy offer search box? I've submitted a bug report to @
The Mayor; about it not clicking the right items in the box, but if he had more helper code for dynamically finding the searchbox I bet it would help him make a fix for it. I suggested code for actually getting the right items but I used a fixed tBox for the search coords so the dynamic box finding would be ideal.
Sure! Here you go:
Simba Code:
function getItemBounds(itemNumber: integer): tBox;
var
i: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
b, searchBox, itemBox: TBox;
begin
if (not self.isOpen()) then
exit();
findColorsTolerance(TPA, 9877448, getClientBounds(), 35);
if length(TPA) < 1 then
begin
WriteLn('.getSearchBoxBounds(): Didn''t find correct colors');
exit();
end;
ATPA := TPA.cluster(5);
ATPA.sortBySize(true);
for i := 0 to high(ATPA) do
begin
b := ATPA[i].getBounds();
if b.getWidth() < 150 then
continue();
searchBox.setBounds(b.x1 + 60, b.y1, b.x2, b.y2); //Here you'll get the bounds of the entire searchbox
itemNumber := itemNumber - 1;
itemBox.setBounds(b.x1 + 60, b.y1 + (15 * itemNumber), b.x2 - 300, b.y2 - (16 * (6 - itemNumber))); //Here you'll get the bounds of the items in the searchbox
end;
result := itemBox;
end;