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.
Simba Code:
{------------------------------------------------------------------------------)
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;