Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.dreambot.api.methods.Calculations;
- import org.dreambot.api.methods.container.impl.bank.BankType;
- import org.dreambot.api.script.AbstractScript;
- import org.dreambot.api.script.ScriptManifest;
- import org.dreambot.api.script.Category;
- import org.dreambot.api.wrappers.interactive.GameObject;
- import org.dreambot.api.wrappers.items.Item;
- @ScriptManifest(author = "You", name = "BankBOT", version = 0.4, description = "Bank bot test", category = Category.MONEYMAKING)
- public class bankBOT extends AbstractScript {
- //IDs
- public static final int BUCKET = 1925;
- //public static final int BUCKET_NOTE = 1926;
- //public static final int BUCKET_WATER = 1229;
- //public static final int BUCKET_WATER_NOTE = 1230;
- //Other
- private static GameObject bankChest;
- private static GameObject fountain;
- private Item bucket;
- public void onStart() {
- log("Starting script...");
- }
- public void onExit() {
- }
- @Override
- public int onLoop() {
- //Set Variables
- bankChest = getGameObjects().closest("Bank chest");
- fountain = getGameObjects().closest("Fountain");
- bucket = getInventory().get(BUCKET);
- //Roofs
- if(getClientSettings().roofsEnabled()){
- log("Turning off roofs.");
- getClientSettings().toggleRoofs(false);
- sleepUntil(() -> !getClientSettings().roofsEnabled(), 2500);
- }
- //Camera Pitch
- if(getCamera().getPitch() < 365){
- getCamera().rotateToPitch(Calculations.random( 300, 383));
- sleepUntil(() -> getCamera().getPitch() > 365, 2500);
- }
- //Open Bank
- if(!getInventory().contains(BUCKET)) {
- if(!getBank().isOpen()) {
- getBank().getClosestBank(BankType.CHEST).interact("Use");
- log("Waiting for transactions");
- sleepUntil(() -> getBank().isOpen(), 2500);
- }
- }
- //Using Bank
- if (getBank().isOpen()){
- log("Bank is Open");
- if (!getInventory().isEmpty()){
- log("Depot the water");
- getBank().depositAllItems();
- sleepUntil(() -> !getInventory().isFull(), 5000);
- } else {
- log("Taking the buckets");
- getBank().withdrawAll(BUCKET);
- sleepUntil(() -> getInventory().isFull(), 1500);
- }
- }
- //Using Buckets on Fountain
- if(getInventory().isFull() && getInventory().contains(BUCKET)){
- log("Inventory is full and we have buckets.");
- if(!getBank().isOpen()){
- if(bucket != null && fountain != null){
- log("Filling the buckets!");
- bucket.useOn(fountain);
- sleepUntil(() -> !getInventory().contains(BUCKET), 20000);
- }
- } else {
- getBank().close();
- sleepUntil(() -> !getBank().isOpen(), 2500);
- }
- }
- return Calculations.random(25, 75);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement