SRL Archive - Reflection Development

R_DepositAllButIDEx


Bad Boy JH

2010-06-13 05:24:56

The procedure will click two identical items, and will try and deposit them both, if however this should solve it.
procedure R_DepositAllButIDEx(IDs : TIntegerArray);
var
I : Integer;
Item : TInvItem;
begin
for I := 1 to 28 do
begin
Item := GetInvItemAt(I);
if(InIntArray(IDs, Item.ID))then Continue;
SetLength(IDs, Length(IDs)+1); //line 1
IDs[High(IDs)] := GetItemIDAt(I); //line 2
R_ClickItem(I, False, 'Deposit-All');
end;
end;
If there is an easier way to do the two marked lines, feel free to change them.

Edit: also how about

function R_DepositAllIDEx(IDs : TIntegerArray): Boolean;
var
I: Integer;
begin
For I := 0 to High(IDs) do
begin
Result := R_ClickItemID(IDs[i], false, 'All');
if not Result then
Break;
end;
end;