Skip to content

Commit 21ebdce

Browse files
committed
fix(grandexchange): improve item click logic in TRSGrandExchangeChat.Click to handle cases when grid is not updated yet
1 parent aa1f4c8 commit 21ebdce

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

osrs/interfaces/mainscreen/grandexchange/grandexchange_chat.simba

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,18 @@ WriteLn GrandExchangeChat.Click('Abyssal whip');
299299
function TRSGrandExchangeChat.Click(item: TRSItem): Boolean;
300300
var
301301
bounds: TBox;
302+
i: Integer;
302303
begin
303-
if Self.Find(item, bounds) then
304+
for i := 0 to 4 do
304305
begin
305-
Mouse.Click(bounds, EMouseButton.LEFT);
306-
Result := SleepUntil(not Self.IsOpen(), 200, 2400);
306+
if Self.Find(item, bounds) then
307+
begin
308+
Mouse.Click(bounds, EMouseButton.LEFT);
309+
Exit(SleepUntil(not Self.IsOpen(), 200, 2400));
310+
end;
311+
312+
if not Self.IsOpen() then Exit;
313+
Sleep(50, 150);
307314
end;
308315
end;
309316

0 commit comments

Comments
 (0)