32 lines
1.0 KiB
Java
32 lines
1.0 KiB
Java
package io.reisub.dreambot.cminer.tasks;
|
|
|
|
import io.reisub.dreambot.util.Constants;
|
|
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.script.TaskNode;
|
|
|
|
public class DoBank extends TaskNode {
|
|
@Override
|
|
public boolean accept() {
|
|
return Bank.isOpen() && Inventory.isFull();
|
|
}
|
|
|
|
@Override
|
|
public int execute() {
|
|
Bank.depositAll(Constants.IRON_BAR);
|
|
MethodProvider.sleep(0, 400);
|
|
Bank.depositAll(Constants.UNCUT_GEMS_FILTER);
|
|
|
|
if (!MethodProvider.sleepUntil(() -> !Inventory.contains(Constants.UNCUT_GEMS_FILTER) && !Inventory.contains(Constants.IRON_BAR), Calculations.random(1200, 1500))) {
|
|
return Calculations.random(250, 400);
|
|
}
|
|
|
|
Bank.close();
|
|
MethodProvider.sleepUntil(() -> !Bank.isOpen(), Calculations.random(1800, 2100));
|
|
|
|
return Calculations.random(250, 400);
|
|
}
|
|
}
|