Skip to content

Commit f03a03d

Browse files
authored
fix: failing test after CollectButton implementation
1 parent 49a7f1c commit f03a03d

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

osrs/interfaces/mainscreen/grandexchange/grandexchange.simba

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,10 @@ begin
366366
Self.Slots[i]._Setup(tba[i]);
367367

368368
with Self.Bounds do
369+
begin
369370
Self.HistoryButton := [X1+7, Y1+7, X1+53, Y1+26];
370-
Self.ConfirmButton := [X1+391, Y1+40, X1+473, Y1+59];
371+
Self.CollectButton := [X1+391, Y1+40, X1+473, Y1+59];
372+
end;
371373
end;
372374

373375
(*
@@ -518,6 +520,27 @@ begin
518520
Result := Self.Slots[slot];
519521
end;
520522

523+
(*
524+
## TRSGrandExchange.Collect
525+
```pascal
526+
function TRSGrandExchange.Collect(): Boolean;
527+
```
528+
Attempts to Collect from the Grand Exchange.
529+
530+
In case of failure, returns False.
531+
532+
Example:
533+
```pascal
534+
WriteLn GrandExchange.Collect();
535+
```
536+
*)
537+
function TRSGrandExchange.Collect(): Boolean;
538+
begin
539+
if OCR.Locate(Self.CollectButton, 'Collect', [RSFonts.WHITE], 0, RSFonts.PLAIN_11) < 0.85 then
540+
Exit(False);
541+
Mouse.Click(Self.CollectButton, EMouseButton.LEFT);
542+
Result := SleepUntil(OCR.Locate(Self.CollectButton, 'Collect', [RSFonts.WHITE], 0, RSFonts.PLAIN_11) = 0,200, 2000);
543+
end;
521544

522545
var
523546
(*

0 commit comments

Comments
 (0)