PHP Code:
{*******************************************************************************
function WaitInvCount(Count, MaxTime: Integer; CountType: (MaxCT, MinCT, ExactCT)): boolean;
By: Rasta Magician
Description: Waits for a maximum inv count. Returns true if InvCount <= Count
*******************************************************************************}
function WaitInvCount(Count, MaxTime: Integer; CountType: (MaxCT, MinCT, ExactCT)): boolean;
var
T: integer;
begin
if not GameTab(tab_Inv) then exit;
Result := false;
T := GetSystemTime + MaxTime;
while GetSystemTime < T do
begin
wait(10);
case CountType of
MaxCT : if InvCount <= Count then Result := true;
MinCT : if InvCount >= Count then Result := true;
ExactCT : if InvCount = Count then Result := true;
end;
if Result then break;
end;
end;
{*******************************************************************************
function WaitInvMaxCount(Count, MaxTime: integer): boolean;
By: Rasta Magician
Description: Waits for a maximum inv count. Returns true if InvCount <= Count
*******************************************************************************}
function WaitInvMaxCount(Count, MaxTime: integer): boolean;
begin
Result := WaitInvCount(Count, MaxTime, MaxCT);
end;
{*******************************************************************************
function WaitInvMinCount(Count, MaxTime: integer): boolean;
By: Rasta Magician
Description: Waits for a minimum inv count. Returns true if InvCount >= Count
*******************************************************************************}
function WaitInvMinCount(Count, MaxTime: integer): boolean;
begin
Result := WaitInvCount(Count, MaxTime, MinCT);
end;
WaitInvMinCount & WaitInvMaxCount will be gone in SRL 5.
If you wish to make the transition smoother, switch to WaitInvCount now
eg
WaitInvCount(InvCount + 1, 10000, ExactCT)
~RM