WolfsRain 0 Share Posted June 25, 2019 I have programmed in Java before and can handle it well. But today it's my first day at the DreamBOT API. I've been trying to find a solution in the docs here but nothing. GOALS: 1st: Get the name of the chest (just to get a handle on the API after reading throw it for 1 hour) 2nd: Make the BOT deposit and withdraw from the bank a set of items. My goal is to get the name of a bank chest or interact with it (withdraw and deposit). The chest that I am working with is the one at Lumbridge (The bank of Gielinor, name of the chest). My Attempt at the code import java.util.Arrays; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.container.impl.bank.BankLocation; 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.Entity; import org.dreambot.api.wrappers.interactive.GameObject; @ScriptManifest(author = "You", name = "BankBOT", version = 0.3, description = "Bank bot test", category = Category.MONEYMAKING) public class bankBOT extends AbstractScript { 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; public void onStart() { log("Starting script..."); } public void onExit() { } @Override public int onLoop() { //Wlaks there getWalking().walk(getBank().getClosestBank(BankType.CHEST)); GameObject chest = getGameObjects().closest(c -> c != null && c.getName().contains("Bank chest") && c.hasAction("Bank")); if (!getBank().isOpen() && chest != null) { log(chest.getName()); sleepUntil(() -> getBank().isOpen(), 2500); } return Calculations.random(500, 600); } } part of the code is credited here. What this code does? Well, so far it walks to the chest which is something, but the part where I want to log the name of the chest doesn't work. So if the name doesn't work, I believe withdraw and deposit would fail as well. Thanks for the interest in the question! Link to comment Share on other sites More sharing options...
Cystic 39 Share Posted June 25, 2019 I'm a pretty bad script tbh but this is what I would do to see where exactly it's stopping. I'd try this. GameObject chest = getGameObjects().closest("Bank chest"); if(chest != null){ log("Chest is not null."); if(chest.hasAction("Bank")){ log("Chest has bank option."); if(!getBank().isOpen()){ log("Bank is not open"); chest.interact("Bank"); } } } It's not the best but this way you'll have a log message at every check that you wanted so you can see where exactly it's getting to before it stops. Link to comment Share on other sites More sharing options...
Zawy 838 Share Posted June 25, 2019 I'm pretty sure the bank chest have the option 'use' instead 'bank'. Kodune, Roma and Leon 1 2 Link to comment Share on other sites More sharing options...
AsBakedAsCake 200 Share Posted June 25, 2019 (edited) If you're banking at somewhere like castlewars you can just walk to the area and use openClosest() Will automatically interact with the bank chest. Doesn't work for all locations, but definitely works at a lot of them. But as Zawy stated already, the option for bank chest is "Use" and not "Bank" Edited June 25, 2019 by AsBakedAsCake Link to comment Share on other sites More sharing options...
Cystic 39 Share Posted June 25, 2019 2 hours ago, AsBakedAsCake said: If you're banking at somewhere like castlewars you can just walk to the area and use openClosest() Will automatically interact with the bank chest. Doesn't work for all locations, but definitely works at a lot of them. But as Zawy stated already, the option for bank chest is "Use" and not "Bank" Yeah, that's what the problem was. I've been messaging him on Discord, we got everything to work. His scripts working well now AsBakedAsCake 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now