March 4, 20179 yr Entity bank = objects.closest("Bank booth"); bank.interact("Bank"); sleep(random(100)); getBank().depositAll(); I've imported bank, this doesnt work?
March 4, 20179 yr 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.
March 4, 20179 yr Bank booths are an RS2Object, not an Entity, also you might want to do a != null check. Edited March 4, 20179 yr by Hydra
March 4, 20179 yr 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()
March 4, 20179 yr if(getBank().isOpen()) { getBank().depositAll(); return random(300, 500); } getBank().open();
March 4, 20179 yr Author 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, 20179 yr by jiggerjaw
March 5, 20179 yr 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:
Create an account or sign in to comment