Twin Posted March 10, 2015 Share Posted March 10, 2015 case BANK: if (bank.isOpen()) { if(inventory.contains("Bow string")) bank.depositAll("Bow string"); if(!inventory.contains("Flax")) bank.withdraw("Flax",28); if(inventory.contains("Flax")) break; } else { bank.open(); } Quote Link to comment Share on other sites More sharing options...
Ziy Posted March 10, 2015 Share Posted March 10, 2015 maybe unrelated to the issue but the case won't break on the else of the if, so then it will fall through to the next case handling block, unless of course you want this Quote Link to comment Share on other sites More sharing options...
Czar Posted March 10, 2015 Share Posted March 10, 2015 If it only withdraws when you manually open the bank, there is an issue with opening it (bank.open()). Personally, I have never it used due to the very same reason this thread is posted. However, in the meantime you'll just have to do the plain old RS2Object bankBooth = getObjects().closest("Bank booth"); or, create a filter for it to find all bank booths with the 'Bank' option to get rid of closed bank booths etc (this also applies to bank npcs and bank chests) and interact with it to open the bank. Quote Link to comment Share on other sites More sharing options...
Joseph Posted March 10, 2015 Share Posted March 10, 2015 op: please note to yourself that bank.open() supports only object also i believe that only these banks work. http://prntscr.com/6ewd9l Quote Link to comment Share on other sites More sharing options...
Twin Posted March 10, 2015 Author Share Posted March 10, 2015 maybe unrelated to the issue but the case won't break on the else of the if, so then it will fall through to the next case handling block, unless of course you want this Yeah I want that. It will just end up going back to that case since everything holds true, it's just now the bank window is open which allows it to execute the if statement. If it only withdraws when you manually open the bank, there is an issue with opening it (bank.open()). Personally, I have never it used due to the very same reason this thread is posted. However, in the meantime you'll just have to do the plain old RS2Object bankBooth = getObjects().closest("Bank booth"); or, create a filter for it to find all bank booths with the 'Bank' option to get rid of closed bank booths etc (this also applies to bank npcs and bank chests) and interact with it to open the bank. Let me try that and see, sorry for the late reply I fell asleep. If it only withdraws when you manually open the bank, there is an issue with opening it (bank.open()). Personally, I have never it used due to the very same reason this thread is posted. However, in the meantime you'll just have to do the plain old RS2Object bankBooth = getObjects().closest("Bank booth"); or, create a filter for it to find all bank booths with the 'Bank' option to get rid of closed bank booths etc (this also applies to bank npcs and bank chests) and interact with it to open the bank. Worked! thank you! But, I also added in an extra ifstatement to my BANKLEAVE case that said if(inventory.contains("Flax"), so that portion of the code won't eveen start unless I have flax in my inventory. op: please note to yourself that bank.open() supports only object also i believe that only these banks work. http://prntscr.com/6ewd9l I was using lumbridge upper, so im not sure if that was exactly the reason. I changed two things around which might have been causing the issue. Quote Link to comment Share on other sites More sharing options...