package io.reisub.dreambot.cminer.tasks; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.container.impl.Inventory; import org.dreambot.api.methods.interactive.Players; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.methods.walking.impl.Walking; import org.dreambot.api.script.TaskNode; public class GoToBank extends TaskNode { public static final Area BANK_AREA = new Area( new Tile(2651, 3287, 0), new Tile(2651, 3280, 0), new Tile(2656, 3280, 0), new Tile(2656, 3287, 0)); @Override public boolean accept() { return Inventory.isFull() && !BANK_AREA.contains(Players.localPlayer()); } @Override public int execute() { if (Walking.shouldWalk(Calculations.random(5, 8))) { Walking.walk(BANK_AREA); } return Calculations.random(250, 400); } }