Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Gundyr on 9-11-2016.
- */
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics2D;
- import org.dreambot.api.methods.Calculations;
- import org.dreambot.api.methods.map.Area;
- import org.dreambot.api.methods.map.Tile;
- import org.dreambot.api.script.AbstractScript;
- import org.dreambot.api.script.Category;
- import org.dreambot.api.script.ScriptManifest;
- import org.dreambot.api.utilities.Timer;
- import org.dreambot.api.wrappers.interactive.GameObject;
- @ScriptManifest(name = "ashpicker", description = "Dem ashes", author = "Grundyr", version = 1.0, category = Category.OTHERS)
- public class main extends AbstractScript {
- Area GE = new Area(3044, 3283, 3067, 3297); // defining an area called cabbagearea
- Tile Banktile = new Tile(3045, 3234); // tile of the depositbox
- Grounditem Ashes; // cabbage
- GameObject Bank; // depositbox
- public int onLoop()
- {
- if(!getInventory().isFull()) {
- if(GE.contains(getLocalPlayer())) {
- Ashes = getGroundItems().closest(a -> a != null && a.getName().equals("Ashes") && c.hasAction("Take")); // defining cabbage by using a filter
- Ashes.interact("Take");
- sleepUntil(() -> Calculations.random(1312, 1939)); // example of conditional sleep, very helpful and should be saved
- sleep(Calculations.random(245, 531));
- } else {
- getWalking().walk(GE.getRandomTile());
- sleep(Calculations.random(1916,2931));
- }
- } else {
- if(Bank.distance(getLocalPlayer()) <= 6) {
- if(getBank().isOpen()) {
- getBank().depositAllItems();
- } else {
- Bank = getGameObjects().closest(b -> b != null && b.getName().equals("Banker") && b.hasAction("Bank"));
- Bank.interact("Bank");
- sleepUntil(() -> getBank().isOpen(), Calculations.random(1074, 1676));
- }
- } else {
- getWalking().walk(Banktile);
- sleep(Calculations.random(1483,2847));
- }
- }
- return Calculations.random(598, 857);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement