Skip to content

Commit 79d5b25

Browse files
committed
feat(GrandExchange): add TRSGrandExchangeSlot.Progress property to track slot progress
1 parent e6e8336 commit 79d5b25

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

osrs/interfaces/mainscreen/grandexchange/grandexchange.simba

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,31 @@ begin
281281
Result := EGEOfferStatus.NONE;
282282
end;
283283

284+
(*
285+
## TRSGrandExchangeSlot.Progress
286+
```pascal
287+
property TRSGrandExchangeSlot.Progress: Integer;
288+
```
289+
Returns the progress percentage of the slot.
290+
291+
Example:
292+
```pascal
293+
WriteLn GrandExchange.Slots[2].Progress;
294+
```
295+
*)
296+
property TRSGrandExchangeSlot.Progress: Integer;
297+
var
298+
tpa: TPointArray;
299+
begin
300+
tpa := Target.FindColor($1964A8, 0, Self.StatusBox);
301+
if not (tpa = []) then
302+
Result := Round(tpa.Bounds.Width() / 105 * 100)
303+
else if Target.HasColor($004A00, 0, 1, Self.StatusBox) then
304+
Result := 100
305+
else
306+
Result := -1;
307+
end;
308+
284309
(*
285310
## TRSGrandExchangeSlot.Open
286311
```pascal

0 commit comments

Comments
 (0)