mormonman
2009-04-25 05:20:12
Since Drags111 never posted these or committed them, here are some deposit functions.
{*******************************************************************************
function R_Deposit(Slot: Integer): boolean;
By: Drags111
Description: Deposits items by slot.
*******************************************************************************}
function R_Deposit(Slot: Integer): boolean;
var
Item: TInvItem;
T: integer;
begin
if not R_BankScreen then Exit;
Item := GetInvItemInfo(Slot);
if (Item.ID = 14665) then Exit;
if (Item.Stack > 1) or (R_CountItems(Item.ID) > 1) then
begin
MouseItem(Slot, false);
ChooseOption('Deposit-All');
end else MouseItem(Slot, true);
MarkTime(T);
While R_ExistsItem(Slot) and (TimeFromMark(T) < 3500) do wait(100);
Result := not R_ExistsItem(Slot);
end;
{*******************************************************************************
procedure R_DepositAllButEx(IDs : TIntegerArray);
By: Drags111 and mormonman
Description: Deposits all items in inventory except the IDs.
*******************************************************************************}
procedure R_DepositAllButEx(Ids : TIntegerArray);
var
I, H : Integer;
Item : TInvItem;
begin
if not R_BankScreen then Exit;
for H := 0 to High(IDs) do
for I := 1 to 28 do
begin
if not R_LoggedIn then Exit;
Item := GetInvItemInfo(I);
if R_ExistsItem(I) then
if not (Item.ID = IDs[H]) then
R_Deposit(I)
end;
end;
{*******************************************************************************
procedure R_DepositAllBut(ID: Integer);
By: Drags111 and mormonman
Description: Deposits all items in inventory except the ID.
*******************************************************************************}
procedure R_DepositAllBut(ID: Integer);
begin
R_DepositAllButEx([ID]);
end;
{*******************************************************************************
procedure R_DepositIDs(IDs : TIntegerArray);
By: mormonman
Description: Deposits all items specified by the IDs.
*******************************************************************************}
procedure R_DepositIDs(IDs : TIntegerArray);
var
I, H : Integer;
Item : TInvItem;
begin
if not R_BankScreen then Exit;
for H := 0 to High(IDs) do
for I := 1 to 28 do
begin
if not R_LoggedIn then Exit;
Item := GetInvItemInfo(I);
if R_ExistsItem(I) then
if (Item.ID = IDs[H]) then
R_Deposit(I)
end;
end;