Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Keyboard.holdShift(c - what does that mean?


    smh1
     Share

    Recommended Posts

    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.methods.container.impl.Inventory;
    import org.dreambot.api.methods.container.impl.bank.Bank;
    import org.dreambot.api.methods.input.Keyboard;
    import org.dreambot.api.methods.interactive.NPCs;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.NPC;
    
    @ScriptManifest(
            author = "smh1",
            description = "Cooker",
            category = Category.COOKING,
            version = 0.01,
            name = "Speed Cooker"
    )
    
    public class SpeedCooker extends AbstractScript {
    
        int[] order = {1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ,19 ,20 ,21 ,22 ,
        23, 24, 25, 26, 27};
    
    
        public int uShark = 383;
        public int shark = 385;
        public int banker = 3194;
        public int fire = 26185;
        NPC bankMan = NPCs.closest(banker);
        
        State state;
    
        @Override
        public int onLoop() {
    
            switch (getState()) {
                case BANKING:
    
    
                    sleep(Calculations.random(100, 10000));
                    if (Inventory.isEmpty() || Inventory.containsAll(shark) && !Bank.isOpen())
                        bankMan.interact("Bank");
                    sleepUntil(() -> Bank.isOpen(), Calculations.random(500, 3250));
                    Bank.depositAllItems();
                    sleepUntil(() -> Inventory.isEmpty(), Calculations.random(1500, 5000));
                    Bank.withdrawAll(uShark);
                    sleepUntil(() -> Inventory.isFull(), Calculations.random(500, 2050));
                    if (Inventory.containsAll(uShark))
                        Bank.close();
    
                    break;
    
                case DROPPING:
    
                    for (int i : order) {
                        Keyboard.holdShift(()-> Inventory.isEmpty(), 1000);
                        Inventory.getItemInSlot(i).interact();
                        Keyboard.releaseShift();
                        break;
                    }
    
                case COOKING:
                    
            }
            return 0;
        }
    
        private enum State {
            BANKING, DROPPING, COOKING
        }
    
        private State getState() {
            if (Inventory.count(shark) == 28) {
                state = State.BANKING;
                log("Banking");
            } else if (Inventory.count(uShark) > 1) {
                state = State.DROPPING;
                log("Dropping");
            }if (Inventory.count(uShark) == 1) {
                state = state.COOKING;
                log("cooking");
                }
                return state;
            }
    
        public void onStart(){
            log("Bot has started");
        }
    
        public void onExit(){
    
        }
    }

    only drops 1 shark, pls help

    Edited by smh1
    Text got scrambled up.
    Link to comment
    Share on other sites

    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 account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.