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
  • Pizza Dough Maker


    renormalize

    Recommended Posts

    Here is a pizza dough maker script that I made in a few hours trying to traverse the API. This is more of an example script that beginners can look at to see how everything comes together. This script can be easily adapted for other simple things such as pastry dough.

     

    Start the script at any bank with pots of flour and jugs of water visible on opening the bank, it will make all of them into pizza bases. Roughly 100k+/hr with no reqs, made 3m in 1 day using this on 2 accounts. After it runs out of flour and water it will just stand there opening the bank because I was too lazy to learn how to close the script, so it's assumed you will correct it if the character runs out of materials. Enjoy!

    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.wrappers.items.Item;
    
    @ScriptManifest(author = "Renormalize", name = "Pizza Dough", version = 1.0, description = "Makes Pizza Dough", category = Category.COOKING)
    public class PizzaDough extends AbstractScript {
    
    	private enum State {
    		BANK, DOUGH
    	};
    
    	private State getState() {
    		if (!getInventory().contains("Pot of flour")
    				|| !getInventory().contains("Jug of water"))
    			return State.BANK;
    		return State.DOUGH;
    	}
    
    	public void onStart() {
    		log("Starting Dough Script!");
    	}
    
    	public void onExit() {
    		log("Ending Dough Script!");
    	}
    
    	@Override
    	public int onLoop() {
    		switch (getState()) {
    		case BANK:
    
    			getBank().open();
    
    			int counter = 0;
    			while (!getBank().isOpen()) {
    				sleep(300);
    
    				// Needed in case bank doesn't open
    				counter++;
    				if (counter > 5)
    					return Calculations.random(500, 600);
    			}
    
    			sleep(350);
    			getBank().depositAllItems();
    			sleep(1200);
    
    			if (getBank().count("Pot of flour") == 0
    					&& getBank().count("Jug of water") == 0
    					&& getBank().isOpen()) {
    				getBank().close();
    				sleep(1000);
    
    				// No Flour or water, should end script here
    				break;
    			}
    
    			// Withdraw Flour and Water
    			sleep(Calculations.random(200, 600));
    			getBank().withdraw("Pot of flour", 9);
    			sleep(1200);
    			getBank().withdraw("Jug of water", 9);
    			sleep(Calculations.random(1000, 1300));
    			getBank().close();
    			sleep(Calculations.random(200, 600));
    			break;
    
    		case DOUGH:
    			Item dough = getInventory().get("Pot of flour");
    			Item water = getInventory().get("Jug of water");
    			dough.useOn(water);
    			sleep(1000);
    
    			if (getWidgets().getWidget(219).getChild(0).getChild(3) == null) {
    				log("First Interface is null, redo loop.");
    				return Calculations.random(700, 1200);
    			} else {
    				getWidgets().getWidget(219).getChild(0).getChild(3).interact();
    				sleep(950);
    			}
    			if (getWidgets().getWidget(309).getChild(6) == null) {
    				log("Second Interface is null, redo loop.");
    				return Calculations.random(700, 1200);
    			} else {
    				getWidgets().getWidget(309).getChild(6).interact("Make All");
    			}
    
    			int i = 0;
    			while (getInventory().contains("Jug of water") && i < 20) {
    				sleep(Calculations.random(700, 1200));
    				i++;
    				// i variable is there to make sure script doesn't get stuck if
    				// dough isn't being made
    			}
    			break;
    		}
    		return Calculations.random(500, 600);
    	}
    }
    
    Link to comment
    Share on other sites

    Well its pretty good and alot faster than this snippet :)

     

    As for the script its good for a start but you should look into sleepUntil conditions :)

    To stop the script you can use stop() and I recommend changing it to (nowater||noflour)&&bankopen

    Yea haha, this is basically a welfare dinhDough! 

     

    Thanks for the advice, there's a lot to improve in this script!

    Link to comment
    Share on other sites

    • 2 years later...

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • 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.