Skip to content

Commit 5a1d4e9

Browse files
authored
Merge pull request #107 from Pauwelz/patch-2
fix: failing test after CollectButton implementation
2 parents 0403d82 + f03a03d commit 5a1d4e9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

osrs/interfaces/mainscreen/grandexchange/grandexchange.simba

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,27 @@ begin
520520
Result := Self.Slots[slot];
521521
end;
522522

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;
523544

524545
var
525546
(*

0 commit comments

Comments
 (0)