Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import org.dreambot.api.methods.Calculations;
  2. import org.dreambot.api.methods.container.impl.bank.BankType;
  3. import org.dreambot.api.script.AbstractScript;
  4. import org.dreambot.api.script.ScriptManifest;
  5. import org.dreambot.api.script.Category;
  6. import org.dreambot.api.wrappers.interactive.GameObject;
  7. import org.dreambot.api.wrappers.items.Item;
  8.  
  9. @ScriptManifest(author = "You", name = "BankBOT", version = 0.4, description = "Bank bot test", category = Category.MONEYMAKING)
  10. public class bankBOT extends AbstractScript {
  11.  
  12.     //IDs
  13.     public static final int BUCKET = 1925;
  14.     //public static final int BUCKET_NOTE = 1926;
  15.     //public static final int BUCKET_WATER = 1229;
  16.     //public static final int BUCKET_WATER_NOTE = 1230;
  17.  
  18.     //Other
  19.     private static GameObject bankChest;
  20.     private static GameObject fountain;
  21.     private Item bucket;
  22.  
  23.     public void onStart() {
  24.         log("Starting script...");
  25.     }
  26.  
  27.     public void onExit() {
  28.  
  29.     }
  30.  
  31.  
  32.  
  33.     @Override
  34.     public int onLoop() {
  35.  
  36.         //Set Variables
  37.         bankChest = getGameObjects().closest("Bank chest");
  38.         fountain = getGameObjects().closest("Fountain");
  39.         bucket = getInventory().get(BUCKET);
  40.  
  41.         //Roofs
  42.         if(getClientSettings().roofsEnabled()){
  43.             log("Turning off roofs.");
  44.             getClientSettings().toggleRoofs(false);
  45.             sleepUntil(() -> !getClientSettings().roofsEnabled(), 2500);
  46.         }
  47.         //Camera Pitch
  48.         if(getCamera().getPitch() < 365){
  49.             getCamera().rotateToPitch(Calculations.random( 300, 383));
  50.             sleepUntil(() -> getCamera().getPitch() > 365, 2500);
  51.         }
  52.  
  53.         //Open Bank
  54.         if(!getInventory().contains(BUCKET)) {
  55.             if(!getBank().isOpen()) {
  56.                 getBank().getClosestBank(BankType.CHEST).interact("Use");
  57.                 log("Waiting for transactions");
  58.                 sleepUntil(() -> getBank().isOpen(), 2500);
  59.             }
  60.         }
  61.         //Using Bank
  62.         if (getBank().isOpen()){
  63.             log("Bank is Open");
  64.             if (!getInventory().isEmpty()){
  65.                 log("Depot the water");
  66.                 getBank().depositAllItems();
  67.                 sleepUntil(() -> !getInventory().isFull(), 5000);
  68.             } else {
  69.                 log("Taking the buckets");
  70.                 getBank().withdrawAll(BUCKET);
  71.                 sleepUntil(() -> getInventory().isFull(), 1500);
  72.             }
  73.         }
  74.         //Using Buckets on Fountain
  75.         if(getInventory().isFull() && getInventory().contains(BUCKET)){
  76.             log("Inventory is full and we have buckets.");
  77.             if(!getBank().isOpen()){
  78.                 if(bucket != null && fountain != null){
  79.                     log("Filling the buckets!");
  80.                     bucket.useOn(fountain);
  81.                     sleepUntil(() -> !getInventory().contains(BUCKET), 20000);
  82.                 }
  83.             } else {
  84.                 getBank().close();
  85.                 sleepUntil(() -> !getBank().isOpen(), 2500);
  86.             }
  87.         }
  88.  
  89.         return Calculations.random(25, 75);
  90.     }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement