Infantry001
2009-07-05 22:36:34
Not complete!
This does not take Bank Tabs into account, sorry!
Well, it withdraws the item using a Name or an ID.
Credits go to the original SRL Withdraw function for the handling of Amount.
Enjoy =)
This does not take Bank Tabs into account, sorry!
Well, it withdraws the item using a Name or an ID.
Credits go to the original SRL Withdraw function for the handling of Amount.
Enjoy =)
{*******************************************************************************
procedure R_Withdraw(Item : Variant; Amount : Integer);
By: Infantry001
Description: Withdraw Amount of Item. Item can be either ID or Name.
*******************************************************************************}
procedure R_Withdraw(Item : Variant; Amount : Integer);
var
I, BankSlot : Integer;
BBox : TBox;
Items : TBankSlotArray;
begin
if not R_BankScreen then exit;
Items := GetBankArray;
case VarType(Item) of
3: for I := 0 to High(Items) do
begin
if (Items[I].ID = Integer(Item)) then
begin
BankSlot := Items[I].Index + 1;
break;
end;
end;
256: for I := 0 to High(Items) do
begin
if (Items[I].Name = Item) then
begin
BankSlot := Items[I].Index + 1;
break;
end;
end;
end;
BBox := BankIndexToMSBox(BankSlot);
If Amount = 1 Then
Begin
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 1);
Wait(RandomRange(50, 150));
End
Else
Begin
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 2);
if (Amount = 5) or (Amount = 10) then
R_ChooseOption('Withdraw-' +IntToStr(Amount))
else if Amount = 0 then
R_ChooseOption('Withdraw-All')
else
if not R_ChooseOption('Withdraw-'+IntToStr(Amount)+' ') then
begin
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 2);
if (R_ChooseOption('Withdraw-X')) then
begin
Wait(1000 + Random(100));
TypeSend(IntToStr(Amount));
end;
end;
end;
end;