SRL Archive - SRL Snippets

WaitSlotCount


The Mayor

2013-06-26 00:50:53

This is useful when picking up or collecting items that stack in one slot (as opposed to WaitInvCount). I made it for picking up charms because sometimes the player runs around objects before picking up.

{------------------------------------------------------------------------------)
Function: WaitSlotCount
By: The Mayor
Description: Waits for an exact item count in an inventory slot.
(------------------------------------------------------------------------------}

Function WaitSlotCount(Count, Slot, MaxTime: Integer): boolean;
Var
T: integer;
Begin
If Not(BankScreen) Then
If Not FTab(tab_Inv) Then exit;

Result := False;
T := (GetSystemTime + MaxTime);

While (GetSystemTime < T) Do
Begin
If GetAmountBox(InvBox(Slot)) = Count Then Result := True;
If Result Then Exit;
End;
End;

seany

2014-09-23 18:29:47

From: The Mayor
This is useful when picking up or collecting items that stack in one slot (as opposed to WaitInvCount). I made it for picking up charms because sometimes the player runs around objects before picking up.

{------------------------------------------------------------------------------)
Function: WaitSlotCount
By: The Mayor
Description: Waits for an exact item count in an inventory slot.
(------------------------------------------------------------------------------}

Function WaitSlotCount(Count, Slot, MaxTime: Integer): boolean;
Var
T: integer;
Begin
If Not(BankScreen) Then
If Not FTab(tab_Inv) Then exit;

Result := False;
T := (GetSystemTime + MaxTime);

While (GetSystemTime < T) Do
Begin
If GetAmountBox(InvBox(Slot)) = Count Then Result := True;
If Result Then Exit;
End;
End;


Why Is this not in the official includes? I haven't tried it yet so can't confirm if it still works or not but I been searching for something like this for over an hour because the official includes don't work correctly. HTYA

The Mayor

2014-09-23 19:27:00

From: hello to you all
Why Is this not in the official includes? I haven't tried it yet so can't confirm if it still works or not but I been searching for something like this for over an hour because the official includes don't work correctly. HTYA


This won't work with SRL6. Check my GAO script for one that does.

seany

2014-09-24 01:49:58

From: The Mayor
This won't work with SRL6. Check my GAO script for one that does.


I was hoping to use it with osr script but maybe it won't work? I'll give it a try anyway HTYA

The Mayor

2014-09-24 03:16:32

From: hello to you all
I was hoping to use it with osr script but maybe it won't work? I'll give it a try anyway HTYA


This may be compatible with SRL-OSR, but I'm not sure as I haven't used SRL5 style code in so long. Don't you wish the OSR include was written exactly the same as SRL6 so then you could use RS3 tutorials!!