Jump to content

BankWithdraw(...)


Joseph

Recommended Posts

So lately ive been having a problem with withdrawing a certain item that isn't in view, when the bank is open. I heard around the forum of other people having this same issue. But finally i got a solution.

			if (client.getBank().isOpen()){
			if (client.getBank().contains(Bucket))	{
			client.getBank().scrollToSlot(client.getBank().getSlotForId(Bucket));
			client.getBank().withdraw5(Bucket);
			sleep(3000);
				}
			}

or for even a shorter code:

			int B = this.client.getBank().getSlotForId(Bucket);
            if (client.getBank().isOpen()){
            if (client.getBank().contains(Bucket))    {
            client.getBank().scrollToSlot(B);
            client.getBank().withdraw5(Bucket);
            sleep(3000);
                }
            }
Edited by josedpay
  • Like 2
Link to comment
Share on other sites

I would personally use something more like this:

public boolean withdraw(int itemId, int quantity) throws InterruptedException
{
	if (!getBank().isOpen())
		return false;
	
	int slotId = getBank().getSlotForId(itemId);

	// getSlotForId returns -1 if the item is unavailable
	if (slotId == -1)
		return false;

	if (!getBank().isSlotVisible(slotId))
		getBank().scrollToSlot(slotId);

	return getBank().withdrawX(itemId, quantity);
}
Edited by bfir3
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...