Optimize bank opening
This commit is contained in:
parent
1122205220
commit
8623509eb4
@ -5,8 +5,10 @@ import org.dreambot.api.methods.Calculations;
|
||||
import org.dreambot.api.methods.MethodProvider;
|
||||
import org.dreambot.api.methods.container.impl.Inventory;
|
||||
import org.dreambot.api.methods.container.impl.bank.Bank;
|
||||
import org.dreambot.api.methods.interactive.GameObjects;
|
||||
import org.dreambot.api.methods.interactive.NPCs;
|
||||
import org.dreambot.api.script.TaskNode;
|
||||
import org.dreambot.api.wrappers.interactive.GameObject;
|
||||
|
||||
public class OpenBank extends TaskNode {
|
||||
@Override
|
||||
@ -18,7 +20,10 @@ public class OpenBank extends TaskNode {
|
||||
|
||||
@Override
|
||||
public int execute() {
|
||||
Bank.openClosest();
|
||||
GameObject bank = GameObjects.closest("Bank chest");
|
||||
if (bank == null) return Calculations.random(250, 400);
|
||||
|
||||
bank.interactForceLeft("Use");
|
||||
if (!Util.sleepUntilMoving()) return Calculations.random(250, 400);
|
||||
|
||||
MethodProvider.sleepUntil(Bank::isOpen, Calculations.random(4000, 4500));
|
||||
|
Loading…
x
Reference in New Issue
Block a user