jiggerjaw Posted March 4, 2017 Share Posted March 4, 2017 Entity bank = objects.closest("Bank booth"); bank.interact("Bank"); sleep(random(100)); getBank().depositAll(); I've imported bank, this doesnt work? Quote Link to comment Share on other sites More sharing options...
Essaint Posted March 4, 2017 Share Posted March 4, 2017 5 minutes ago, jiggerjaw said: Entity bank = objects.closest("Bank booth"); bank.interact("Bank"); sleep(random(100)); getBank().depositAll(); I've imported bank, this doesnt work? Not every location has a bank booth. Quote Link to comment Share on other sites More sharing options...
Hel Posted March 4, 2017 Share Posted March 4, 2017 (edited) Bank booths are an RS2Object, not an Entity, also you might want to do a != null check. Edited March 4, 2017 by Hydra Quote Link to comment Share on other sites More sharing options...
Explv Posted March 4, 2017 Share Posted March 4, 2017 16 minutes ago, jiggerjaw said: Entity bank = objects.closest("Bank booth"); bank.interact("Bank"); sleep(random(100)); getBank().depositAll(); I've imported bank, this doesnt work? Use getBank().open() 1 Quote Link to comment Share on other sites More sharing options...
Juggles Posted March 4, 2017 Share Posted March 4, 2017 Check if bank is open before depositing all Quote Link to comment Share on other sites More sharing options...
Team Cape Posted March 4, 2017 Share Posted March 4, 2017 if(getBank().isOpen()) { getBank().depositAll(); return random(300, 500); } getBank().open(); Quote Link to comment Share on other sites More sharing options...
jiggerjaw Posted March 4, 2017 Author Share Posted March 4, 2017 (edited) Ha, shoulda been more specific... the bank opens perfectly fine, it doesn't deposit. Guess it could be that it's trying to deposit before the bank is open, I'll try that. Thanks Jugs *How do I give +Rep? I clicked the check mark and nothing happened Edited March 4, 2017 by jiggerjaw Quote Link to comment Share on other sites More sharing options...
Explv Posted March 5, 2017 Share Posted March 5, 2017 20 minutes ago, jiggerjaw said: Ha, shoulda been more specific... the bank opens perfectly fine, it doesn't deposit. Guess it could be that it's trying to deposit before the bank is open, I'll try that. Thanks Jugs *How do I give +Rep? I clicked the check mark and nothing happened Yes, in your snippet you are sleeping for 0-100ms, not exactly long enough for the bank to open, especially if your player has to walk there first. If you use getBank().open() it will sleep until the bank is open, so something like this should work: if (!getBank().isOpen()) { getBank().open(); } else { getBank().depositAll(); } 1 hour ago, Hydra said: Bank booths are an RS2Object, not an Entity, also you might want to do a != null check. RS2Object is a subinterface of Entity, so what he wrote is fine: 3 Quote Link to comment Share on other sites More sharing options...