Here is the function in my AK cooker, works 100%…
function R_WithdrawItemID(ID, Amount: Integer): Boolean;
var
I, WhichBankTab, ItemSlot: Integer;
BankTabItemIDs: TIntegerArray;
RelativePoint: TPoint;
TabBox, ItemBox: TBox;
begin
for ItemSlot := 0 to 515 do
if ID = GetChildComponentID(INTERFACE_BANK, 93, ItemSlot) then
Break;
if GetChildComponentID(INTERFACE_BANK, 93, ItemSlot) = -1 then
begin
Writeln('ItemID ' + IntToStr(ID) + ' not found.');
Exit;
end;
if ItemSlot = 515 then
begin
Writeln('ItemID ' + IntToStr(ID) + ' not found.');
Exit;
end;
RelativePoint.x := GetChildComponentRelativeX(INTERFACE_BANK, 93, ItemSlot);
RelativePoint.y := GetChildComponentRelativeY(INTERFACE_BANK, 93, ItemSlot);
if (RelativePoint.x = 0) then
begin
SetLength(BankTabItemIDs, 9);
for I := 1 to 9 do
BankTabItemIDs[I - 1] := GetInterfaceComponentID(INTERFACE_BANK, 47 + ((9 - I) * 2));
for I := ItemSlot downto 0 do
if InIntArrayEx(BankTabItemIds, WhichBankTab, GetChildComponentID(INTERFACE_BANK, 93, I)) then
Break;
TabBox.x1 := GetInterfaceComponentRelativeX(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2)) + 4;
TabBox.y1 := GetInterfaceComponentRelativeY(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2)) + 4;
TabBox.x2 := TabBox.x1 + GetInterfaceComponentWidth(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2));
TabBox.y2 := TabBox.y1 + GetInterfaceComponentHeight(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2));
MouseBox(TabBox.x1, TabBox.y1, TabBox.x2, TabBox.y2, 1);
RelativePoint.x := GetChildComponentRelativeX(INTERFACE_BANK, 93, ItemSlot);
RelativePoint.y := GetChildComponentRelativeY(INTERFACE_BANK, 93, ItemSlot);
end;
ItemBox.x1 := RelativePoint.x + GetInterfaceComponentRelativeX(INTERFACE_BANK, 93) + 4;
ItemBox.y1 := RelativePoint.y + GetInterfaceComponentRelativeY(INTERFACE_BANK, 93) + 4;
ItemBox.x2 := ItemBox.x1 + GetChildComponentWidth(INTERFACE_BANK, 93, ItemSlot)
ItemBox.y2 := ItemBox.y1 + GetChildComponentHeight(INTERFACE_BANK, 93, ItemSlot)
if Amount = 1 then
begin
MouseBox(ItemBox.x1, ItemBox.y1, ItemBox.x2, ItemBox.y2, 1);
Result := True;
Exit;
end;
MouseBox(ItemBox.x1, ItemBox.y1, ItemBox.x2, ItemBox.y2, 2);
if Amount = 0 then
Result := R_ChooseOption('ithdraw-All') else
if OptionExists('ithdraw-' + IntToStr(Amount)) then
Result := R_ChooseOption('ithdraw-' + IntToStr(Amount)) else
begin
if R_ChooseOption('ithdraw-X') then
begin
Wait(RandomRange(1200, 1500));
TypeSend(IntToStr(Amount));
Result := True;
end;
end;
end;